Opalsec

|

The Defender’s Guide to the 3CX Supply Chain Attack

What the heck is going on?

The Defender's Guide to the 3CX Supply Chain Attack

This all kicked off on Wednesday with SentinelOne’s release of a post that looked at a campaign dubbed “Smooth Operator”, which essentially found that the 3CX Voice Over Internet Protocol (VOIP) desktop client – used by some 600,000 companies worldwide and over 12 million daily users – had been compromised with a malicious update.

The Defender's Guide to the 3CX Supply Chain Attack

What can I do?

Well for one – ensure you’ve removed any exceptions that might have been created for the application.

The compromised software has been assigned CVE-2023-29059, and impacts the following versions on Windows and MacOS:

  1. Windows: versions 18.12.407 and 18.12.416 of the Electron Windows application shipped in Update 7, and
  2. Versions 18.11.1213, 18.12.402, 18.12.407, and 18.12.416 of the Electron MacOS application.

Florian Roth and his team have also shared several Sigma and YARA rules to help identify compromised files that were leveraged in the attack.

How did this happen?

Customer reports of the trojanised application being quarantined by antivirus products first began surfacing the week prior, on the 22nd of March, though SentinelOne have reported observing activity as far back as March 8th.

Huntress Labs have taken it one even further, having found network infrastructure being established as far back as February 2022:

The Defender's Guide to the 3CX Supply Chain Attack
Figure 1: The planning and execution was months in the making

Whose supply chain was hit?

3CX were quick to point fingers at ffmpeg – the upstream code supplier for the trojanized ffmpeg.dll binary – but they clearly weren’t in the mood for it and told 3CX to double-check their homework:

3CX have engaged Mandiant to conduct an investigation, which is ongoing as of the time of writing.



How does the attack work?

A trojanized update which was sent out to customers included a modified and malicious version of the legitimate ffmpeg.dll and d3dcompiler.dll binaries, which then retrieved an obfuscated and encrypted .ICO file from an attacker-controlled Github repository.

The Defender's Guide to the 3CX Supply Chain Attack
Figure 2: Attack Flow of the malicious update (Credit: @fr0gger_)

MacOS Execution Chain

A malicious update was also issued for the MacOS version of the 3CX installer, and it appears to have actually pre-dated the Windows attacks, with the earliest vulnerable version – 18.11.1213 – being deployed in January this year.

You can find a more detailed analysis of the execution chain in Patrick Wardle’s blog, but for a quick overview, Thomas Roccia (a.k.a @fr0gger_) has you covered:

The Defender's Guide to the 3CX Supply Chain Attack


Signed =/= Trusted

Notably, ReversingLabs reported in their analysis of the Windows sample that they “identified signatures in the appended code pointing to SigFlip, a tool for modifying the authenticode-signed Portable Executable (PE) files without breaking the existing signature.”

This was elaborated on by Will Dormann, who pointed to its apparent use to abuse a 10 year old flaw – CVE-2013-3900 – classed as a “WinVerifyTrust Signature Validation Vulnerability.”

While a fix was issued back in 2013, Microsoft made it opt-in, as it could break functionality of legitimate apps such as Google Chrome, which modifies the Authenticode signature as part of denoting if diagnostic logs are meant to be collected and sent.

The Defender's Guide to the 3CX Supply Chain Attack
Figure 3: The signature remains intact on the modified dll

So, who did it?

CrowdStrike have attributed the attack to a group they track as Labyrinth Chollima, a DPRK-aligned actor with form conducting cyber espionage, cryptocurrency theft and destructive attacks. Their analysis found “the HTTPS beacon structure and encryption key match those observed by CrowdStrike in a March 7, 2023 campaign attributed with high confidence to DPRK-nexus threat actor LABYRINTH CHOLLIMA.”

Analysts from Sophos and Volexity has also corroborated this attribution to some degree, with Sophos noting the code was “a byte-to-byte match” with what has been seen in previous activity by the Lazarus Group – the catch-all threat group for DPRK-aligned attackers – and Volexity finding the specific shellcode sequence “appears to have been only used in the ICONIC loader and the APPLEJEUS malware, which is known to be linked to Lazarus.”

How has this been handled?

Unfortunately, despite receiving dozens of reports from users of multiple EDR products (SentinelOne, CrowdStrike, ESET, Palo Alto Networks, and SonicWall, to name a few) flagging the VOIP client as malicious, 3CX simply responded by telling customers to add exclusions to allow it to continue to run, and to follow-up with their EDR vendor to resolve the problem.

The Defender's Guide to the 3CX Supply Chain Attack
Figure 4: 3CX: “We aren’t malware authors therefore this isn’t malware.”

In an interview with CyberScoop, 3CX CEO Nick Galea noted that antivirus products flagged their software as malicious “quite frequently — so I have to be honest we didn’t take it that seriously […] we did upload it to a site called VirusTotal to check […] and none of the anti-virus engines flagged us of having a virus, so we just left it at that.”

If that’s not enough to have your head spinning, cop this – Galea only acknowledged the vulnerability on forums on the 31st of March – more than a week after users began reporting the issue – and claims “it was only reported to [them] yesterday night.”

The Defender's Guide to the 3CX Supply Chain Attack
The Defender's Guide to the 3CX Supply Chain Attack
Figure 5: My boy Jackie knows what’s up

True to form

A post by respected researcher Kevin Beaumont shows this may be symptomatic of the security culture at 3CX, as he highlighted that when he attempted last year to report a vulnerability that “3CX took little responsibility, didn’t fix it, and started arguing on Twitter”.

The vulnerability? That files – including the admin password – could be read in plaintext.



Further Reading

  1. CrowdStrike’s report
  2. SentinelOne’s report
  3. Volexity’s analysis
  4. Huntress’ early analysis
  5. Follow-up analysis by Huntress
  6. Sophos’ analysis
  7. ReversingLab’s analysis
  8. Patrick Wardle’s Analysis of the MacOS attack chain
  9. Analysis & queries by Splunk

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *