VOOZH about

URL: https://thenewstack.io/malicious-code-in-linux-xz-libraries-endangers-ssh/

⇱ Malicious Code in Linux xz Libraries Endangers SSH - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2024-03-30 12:25:50
Malicious Code in Linux xz Libraries Endangers SSH
Linux / Open Source / Security

Malicious Code in Linux xz Libraries Endangers SSH

Most users won't be affected by this malware, but if it had gone undetected for a few more months, everyone using Linux would have faced their biggest security disaster ever. 
Mar 30th, 2024 12:25pm by Steven J. Vaughan-Nichols
👁 Featued image for: Malicious Code in Linux xz Libraries Endangers SSH
Feature image by Łukasz Mrowiec from Pixabay.

You may never have heard of the xz data compression code, but it’s vital to numerous programs, and we now know someone has planted malicious code in it.

When Red Hat first broke the news that the latest version of the xz data compression libraries contained a booby trap, People were concerned but not too worried. After all, they reasoned, it appeared many at first thought it was just another security hole. While others thought that if it only affected the Fedora Linux 40 beta, how bad could it possibly be?

The answer: Very, very bad indeed.

You see, while no one in their right mind would run a Fedora beta in production, the problem isn’t with Fedora. It’s with the new xz libraries: xz-libs-5.6.0-1.fc40.x86_64.rpm and xz-libs-5.6.0-2.fc40.x86_64.rpm.

The libraries contain malicious code designed to enable attackers to take over systems,  with unauthorized access. This backdoor malware was written into the upstream xz repository and then placed in its tarballs.

In a word, that’s bad, with capital letters.

Red Hat gave this malicious code in its CVE-2024-3094 report the highest possible Common Vulnerability Scoring System (CVSS) rating of 10. Or, as I like to call that level of bug, it’s “rip the power cord out of the wall now and save yourself any additional pain” time.

Andres Freund, a Microsoft principal software engineer, analyzed the xz malware. Freund found the attacker had injected an obfuscated script that activated the backdoor. In some cases, its main attack wouldn’t work, and the only result was to massively slow down SSH logins.

Indeed, in the case of the popular SSH program OpenSSH, you don’t even need to start it as a server for the slowdown effect to hit your system. Since SSH is essential for Linux development and administration, that’s more than bad enough.

What really makes this a major PITA problem is that these libraries aren’t just in Fedora. Oh my, no. Xz is a core Linux utility. You’ll find these libraries everywhere.

The most troubling thing about this incident is that it appears a trusted xz maintainer, Jia Tan, was the hacker.

Freund said, “Given the activity over several weeks, the committer is either directly involved or there was some quite severe compromise of their system. Unfortunately, the latter looks like the less likely explanation, given that they communicated on various lists about the ‘fixes’ mentioned above.”

While malicious code has been injected into trusted open source code by maintainers before, it’s a truly rare occurrence. To the best of my knowledge, this has never happened to an important Linux utility before.

Oh yeah, there may be more security snakes hiding in the grass. Freund admits, ” I am not a security researcher, nor a reverse engineer.  There’s lots of stuff I have not analyzed, and most of what I observed is purely from observation rather than exhaustively analyzing the backdoor code.”

The good news — there is some — is that xz 5.6.0 and 5.6.1 have not yet widely been included in Linux distributions. Where it has been incorporated, the code has mostly been in pre-release versions. The bad news is, besides Fedora,  it’s already in early versions of Debian, openSUSE, Ubuntu, etc. You name it, and it’s a cutting-edge distribution or a beta, chances are the bad code is hiding inside.

So what can you do about it? Well, the default suggestion is to revert away from xz 5.6.0/5.6.1. But, warns Debian developer Joey Hess, that may not be enough. Hess fears Tan may have hidden other backdoors in xz. Hess suggests you revert all the way back to xz 5.3.1.

If, of course, you can find that code. GitHub has disabled the xz repository. This really is a first-class rip-roaring security mess.

People have long been concerned with xz’s code quality and, indeed, some of the project’s basic premises. With this foul-up, I think it’s time to seriously consider pulling xz and replacing it from the source code up.

Most users won’t be affected by this malware, but if it had gone undetected for two or three more months, everyone using Linux would have faced its biggest security disaster ever.

TRENDING STORIES
Steven J. Vaughan-Nichols, aka sjvn, has been writing about technology and the business of technology since CP/M-80 was the cutting-edge PC operating system, 300bps was a fast internet connection, WordStar was the state-of-the-art word processor, and we liked it.
Read more from Steven J. Vaughan-Nichols
SHARE THIS STORY
TRENDING STORIES
Red Hat is a sponsor of The New Stack.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.