Lucene search

K
thnThe Hacker NewsTHN:69731AD071C201A913B140323B1160A5
HistoryApr 02, 2024 - 1:18 p.m.

Malicious Code in XZ Utils for Linux Systems Enables Remote Code Execution

2024-04-0213:18:00
The Hacker News
thehackernews.com
51
xz utils
linux
remote code execution
cve-2024-3094
supply chain compromise
data compression
jia tan
cybersecurity
backdoor
akamai
social engineering
maintainer responsibilities
lasse collin
tukaani project
supply chain attack

0.133 Low

EPSS

Percentile

95.6%

XZ Utils for Linux

The malicious code inserted into the open-source library XZ Utils, a widely used package present in major Linux distributions, is also capable of facilitating remote code execution, a new analysis has revealed.

The audacious supply chain compromise, tracked as CVE-2024-3094 (CVSS score: 10.0), came to light last week when Microsoft engineer and PostgreSQL developer Andres Freund alerted to the presence of a backdoor in the data compression utility that gives remote attackers a way to sidestep secure shell authentication and gain complete access to an affected system.

β€œI was doing some micro-benchmarking at the time, needed to quiesce the system to reduce noise,” Freund said in a post shared on Mastodon. β€œSaw sshd processes were using a surprising amount of CPU, despite immediately failing because of wrong usernames etc.”

β€œProfiled sshd, showing lots of cpu time in liblzma, with perf unable to attribute it to a symbol. Got suspicious. Recalled that I had seen an odd valgrind complaint in automated testing of postgres, a few weeks earlier, after package updates.”

β€œReally required a lot of coincidences,” Freund added.

XZ Utils is a command-line tool for compressing and decompressing data in Linux and other Unix-like operating systems.

The malicious backdoor code is said to have been deliberately introduced by one of the project maintainers named Jia Tan (aka Jia Cheong Tan or JiaT75) in what appears to be a meticulous attack spanning multiple years. The GitHub user account was created in 2021. The identity of the actor(s) is presently unknown.

Cybersecurity

β€œThe threat actor started contributing to the XZ project almost two years ago, slowly building credibility until they were given maintainer responsibilities,” Akamai said in a report.

In a further act of clever social engineering, sockpuppet accounts like Jigar Kumar and Dennis Ens are believed to have been used to send feature requests and report a variety of issues in the software in order to force the original maintainer – Lasse Collin of the Tukaani Project – to add a new co-maintainer to the repository.

Enter Jia Tan, who introduced a series of changes to XZ Utils in 2023, which eventually made their way to release version 5.6.0 in February 2024. They also harbored a sophisticated backdoor.

XZ Utils for Linux

Source: Thomas Roccia

β€œAs I have hinted in earlier emails, Jia Tan may have a bigger role in the project in the future,” Collin said in an exchange with Kumar in June 2022.

β€œHe has been helping a lot off-list and is practically a co-maintainer already. :-) I know that not much has happened in the git repository yet but things happen in small steps. In any case some change in maintainership is already in progress at least for XZ Utils.”

The backdoor affects XZ Utils 5.6.0 and 5.6.1 release tarballs, the latter of which contains an improved version of the same implant. Collins has since acknowledged the project’s breach, stating both the tarballs were created and signed by Jia Tan and that they had access only to the now-disabled GitHub repository.

β€œThis is clearly a very complex state-sponsored operation with impressive sophistication and multi-year planning,” firmware security company Binarly said. β€œSuch a complex and professionally designed comprehensive implantation framework is not developed for a one-shot operation.”

XZ Utils for Linux

A deeper examination of the backdoor by open-source cryptographer Filippo Valsorda has also revealed that the affected versions allow specific remote attackers to send arbitrary payloads through an SSH certificate which will be executed in a manner that circumvents authentication protocols, effectively seizing control over the victim machine.

β€œIt appears as though the backdoor is added to the SSH daemon on the vulnerable machine, enabling a remote attacker to execute arbitrary code,” Akamai said. β€œThis means that any machine with the vulnerable package that exposes SSH to the internet is potentially vulnerable.”

Cybersecurity

In other words, the backdoor allows a remote attacker with a predetermined private key to hijack the SSH daemon in order to execute malicious commands.

Needless to say, the accidental discovery by Freund is one of the most significant supply chain attacks discovered to date and could have been a severe security disaster had the package been integrated into stable releases of Linux distributions.

β€œThe most notable part of this supply chain attack is the extreme levels of dedication of the attacker, working more than two years to establish themselves as a legitimate maintainer, offering to pick up work in various OSS projects and committing code across multiple projects in order to avoid detection,” JFrog said.

As with the case of Apache Log4j, the incident once again highlights the reliance on open-source software and volunteer-run projects, and the consequences that could entail should they suffer a compromise or have a major vulnerability.

β€œThe bigger β€˜fix’ is for organizations to adopt tools and processes that allow them to identify signs of tampering and malicious features within both open source and commercial code used in their own development pipeline,” ReversingLabs said.

Found this article interesting? Follow us on Twitter ο‚™ and LinkedIn to read more exclusive content we post.