HT to @wdormann here - somebody has backdoored the open source project XZ which has downstream impacts.

For example, although OpenSSH doesn’t use XZ, Debian patch OpenSSH and introduced a dependency which translates as the XZ changes introducing a sshd authentication bypass backdoor it appears.

One dude bothered to investigate in his free time about why ssh was running slow, so it was caught fairly early - i.e. hopefully before distros started bundling it.

https://www.openwall.com/lists/oss-security/2024/03/29/4

oss-security - backdoor in upstream xz/liblzma leading to ssh server compromise

Worryingly it looks like the backdoor comes via one of the two main devs and dates back over a month from their GitHub account, with legit commits too - XZ is used in systemd so this one might play out for a while.
I suspect distros probably want to roll XZ back to around January 2024, stop bundling updates until the developer is removed in GitHub or a logical explanation can be given, and somebody needs to fund a code review of it.

Here we go: https://www.bleepingcomputer.com/news/security/red-hat-warns-of-backdoor-in-xz-tools-used-by-most-linux-distros/

As I said, the impact here will be very limited due to how quick it was caught. Everybody owes the finder a beer.

Red Hat warns of backdoor in XZ tools used by most Linux distros

Today, Red Hat warned users to immediately stop using systems running Fedora development and experimental versions because of a backdoor found in the latest XZ Utils data compression tools and libraries.

BleepingComputer
Postgres developer @AndresFreundTec saving Linux security from backdoors as a side of desk activity
CISA advisory: Reported Supply Chain Compromise Affecting XZ Utils Data Compression Library, CVE-2024-3094 https://www.cisa.gov/news-events/alerts/2024/03/29/reported-supply-chain-compromise-affecting-xz-utils-data-compression-library-cve-2024-3094
The person/account on XZ repo also altered the security disclosure policy on that and other repos they author in months prior.
Interesting find by @fuomag9 - the XZ repo person tried getting Ubuntu to update yesterday by filing a bug report https://bugs.launchpad.net/bugs/2059417
Bug #2059417 “Sync xz-utils 5.6.1-1 (main) from Debian unstable ...” : Bugs : xz-utils package : Ubuntu

NOTE: THIS IS AN ATTEMPT AT INCLUDING A BACKDOOR. THIS IS LEFT FOR HISTORICAL PURPOSES ONLY AND MUST NOT BE DONE. Please sync xz-utils 5.6.1-1 (main) from Debian unstable (main) Hello! I am one of the upstream maintainers for XZ Utils. Version 5.6.1 was recently released and uploaded to Debian as a bugfix only release. Notably, this fixes a bug that causes Valgrind to issue a warning on any application dynamically linked with liblzma. This includes a lot of important applications. This cou...

Launchpad
The Twilight zone time - a bug from 2015 comes back around in XZ incident, it appears https://github.com/google/sanitizers/issues/342
Segfault in instrumented programs that use GNU indirect functions. · Issue #342 · google/sanitizers

Originally reported on Google Code with ID 342 What steps will reproduce the problem? 1. Testcase is attached. Compile with GCC with -fsanitize=address option. 2. Run. 3. What is the expected outpu...

GitHub
Multiple different XZ repos and website have been suspended by GitHub.

Back in 2022 a host of characters appeared and basically bullied the creator of the XZ project to hand it over to somebody else - at the time the guy cited mental health issues around not updating the project quickly.

At the time he was already talking about maybe handing over to the account who years later introduced the backdoor.

In mid 2023 said account introduced a change to Google’s OSS Fuzzer to weaken detection for XZ.

Somebody played a years long game of Jenga and lost.

Before everybody high fives each other, this is how the backdoor was found: somebody happened to look at why CPU usage had increased in sshd, and did all the research and notification work themselves. By this point the backdoor had been there for a month unnoticed.

I’ve made the joke before that if GCHQ aren’t introducing backdoors and vulns in open source that I want a tax refund. It wasn’t a joke. And it won’t be just be GCHQ.

https://mastodon.social/@AndresFreundTec/112180406142695845

Another two thoughts on XZ -

- sshd itself has no dependency on the XZ utils library. The streams got crossed in a way I don’t think anybody understood (except the threat actor).

- had that backdoor been performant with sshd, I don’t think anybody would have spotted it.

The way this played out opens a window of opportunity to go back and look at both issues.

Really good timeline of what is known to have happened so far. It looks like the rogue developer deliberately introduced a vulnerability in other package, too - I haven’t seen anybody else mention this.

Reading the dev’s GitHub history, they’ve been making changes to other open source projects too around compression. It also appears they/somebody involved has other accounts, too.

https://boehs.org/node/everything-i-know-about-the-xz-backdoor

Everything I know about the XZ backdoor

Please note: This is being updated in real-time. The intent is to make sense of lots of simultaneous discoveries

How far the rabbit hole goes - back in 2021 they deliberately introduced a risky change in the compression library libarchive. Nobody noticed. This is shipped in a ton of systems:
https://github.com/libarchive/libarchive/pull/1609

Whoever the threat actor is knows what they are doing as they’ve gone after chained dependencies around compression.

Added error text to warning when untaring with bsdtar by JiaT75 · Pull Request #1609 · libarchive/libarchive

Added the error text when printing out warning and errors in bsdtar when untaring. Previously, there were cryptic error messages when, for example in issue #1561, the user tries to untar an archive...

GitHub

If anybody thinks this kind of thing is unique, it isn’t.

Example - CVE-2021-44529 in Ivanti Endpoint Manager. The cause?

Backdoor in open source code, was there for 7 years.

https://borncity.com/win/2024/02/22/ivanti-endpoint-manager-vulnerability-cve-2021-44529-code-injection-or-backdoor/

XZ Embedded Linux kernel module for IoT devices, 10 days ago had a change submitted to add Jia Tan (backdoor author) as a maintainer.

https://lore.kernel.org/lkml/202403201[email protected]/

Linux kernel documentation: https://docs.kernel.org/staging/xz.html

The GitHub repository for XZ Embedded kernel module has also been disabled: https://github.com/tukaani-project/xz-embedded/

[PATCH 01/11] MAINTAINERS: Add XZ Embedded maintainers - Lasse Collin

Original maintainer of XZ repos has posted a short update:

https://tukaani.org/xz-backdoor/

HT @SamantazFox

XZ Utils backdoor

Dave Anderson (@[email protected])

The poor original maintainer of xz is on it now, and has already found another "fun" thing: https://git.tukaani.org/?p=xz.git;a=commitdiff;h=f9cf4c05edd14dedfe63833f8ccbe41b55823b00 . The configure check for enabling the Landlock sandboxing facility was subtly broken, so that Landlock support would never get enabled. The original malicious commit landed around the same timeframe as the main backdoor, also at an abnormal time of day compared to the new maintainer's historical activity pattern.

Hachyderm.io

Also since there’s a lot going on here, up thread I mentioned a 2015 minor bug in Google’s OSS Fuzzer (security testing tool) - the threat actor deliberately introduced the bugged function into XZ, then used that to get an exception in OSS Fuzzer’s code to stop scanning of XZ.

I’ve just been looking at the actual backdoor for a few hours with greater minds than me, it’s incredibly complex - it basically piggy backs RSA key RCE inside sshd as a Trojan horse. Somebody/bodies spent $$ on this.

@GossiTheDog @SamantazFox

I don't know which is the biggest crime: naming a product or service with a word of the English language, like "upstream", or mentioning that product or service in an article without capitalizing, changing the font, or qualifiying it -- as "software from upstream" rather than "software from Upstream" or "software from the /upstream/ site".

@JorgeStolfi @GossiTheDog @SamantazFox No one is mentioning a product or service called "Upstream" in any of these articles. They are using the word upstream which has a meaning in the software development context. You are the one who is mistaken :)
@GossiTheDog @SamantazFox
Not wanting to pile on, I hope people are giving Lasse all the support in assuring his own infrastructure hasn't been compromised by the "Jia Tan" operation.
@GossiTheDog can’t help but think that with just a liiiiiitle more patience and a liiiiitle more skill this would have been a very real problem.

@GossiTheDog The whole Tukaani Project on GitHub has been disabled - all of its code repositories:

https://github.com/tukaani-project/

The mirrors work, though:

https://git.tukaani.org/

Tukaani

Tukaani has 5 repositories available. Follow their code on GitHub.

GitHub

@bontchev @GossiTheDog We have an official communication from the original developer, Lasse Collin, btw:

https://tukaani.org/xz-backdoor/

XZ Utils backdoor

@SamantazFox @bontchev @GossiTheDog Hope Lasse is OK. Must suck already being burnt out from maintaining it and then getting this shit show dropped on him.
@GossiTheDog
If our goal includes disrupting social media silos, we have to be prepared for the silo people to attack us (not assuming this guy was one, just saying). We are no longer under the radar.

@GossiTheDog “visit #tukaani on Freenode”

>Freenode

Yeah, he needs some maintenance help.

@GossiTheDog in fairness, it's hard to tell the difference between the intentional problems in Ivanti products and the unintentional ones.
@GossiTheDog this link has a better detail on the actual obfuscated code https://www.labs.greynoise.io/grimoire/2024-02-what-is-this-old-ivanti-exploit/
GreyNoise Labs - Code injection or backdoor: A new look at Ivanti’s CVE-2021-44529

In 2021, Ivanti patched a vulnerability that they called “code injection”. Rumors say it was a backdoor in an open source project. Let’s find out what actually happened!

GreyNoise Labs
@GossiTheDog Feel free to correct me, but the code with the backdoor was only a mirrored repository. The actual repository never contained it.
@GossiTheDog
/me
- Reads article
- adds new detection to his vulnerability scanner.
@GossiTheDog @gvenema when open source is even more open bc of backdoor its arguably open sourcer

@hanscees @GossiTheDog

It should have been, may the source be with you!

@hanscees @GossiTheDog

On the other hand. On closed source Windows people generally run all kinds of crummy kernel level drivers to maximize a game framerate or because their hardware brand uses some fancy service management tool that is riddled with every security malpractice that you can throw a book at, just to make sure that you get the brand™ experience.

And the source code leaked on multiple occasions, and is perfectly open book to the larger nation states. So, give me open source.

@GossiTheDog We can't expect everyone who pulls source code to be expert at injection & backdoors, or that they will read and understand every line. It can take months to get intimately acquainted with some code. We need an organization of paid programmers whose sole purpose is to vet open source code, and accept that releases will take longer for complicated packages. Volunteerism clearly fails to stop bad actors. A federal grant would be appropriate. It's a national security risk.
@GossiTheDog
For every one that is found hundreds or thousands persist undetected.
@GossiTheDog this doesn‘t really seem confirmed as malicious yet, looking at the GitHub thread?

@GossiTheDog The very recent zstd fork branch updates agree with the assessment that the compression ecosystem as a whole was the domain this threat actor was playing in:

https://github.com/JiaT75/zstd/branches/all

Activity · JiaT75/zstd

Zstandard - Fast real-time compression algorithm. Contribute to JiaT75/zstd development by creating an account on GitHub.

GitHub
@GossiTheDog while this is funny, it’s very unlikely to be a “person from China” the South East Asian persona used was a cover (going as far as using Singaporean VPNs). Meanwhile the git contribution graph fits more to a work day in Eastern Europe.
@Euph0r14 @GossiTheDog quick question, how do you know for the Singaporean VPN? It has been mentioned somewhere?

@fl @GossiTheDog “Jia Tan” was active on libera IRC (under the username “jiatan”). If you have access to historic client logs from the libera IRC, their IP shows up. Someone was kind of enough to share their logs with Open source investigators.

From that investigator:
“Jia Tan connected to Libera via a VPN out of Singapore.”

Not sure if this has been publicly mentioned yet.

@GossiTheDog

We do not know yet where this guy comes from for now, do we?

@GossiTheDog This does not seem helpful.

@GossiTheDog wait, are we at "implementing features to get plausible deniability for evading vuln scanning?"

Because if so this feels quite novel. At the very least I can't remember a comparable supply chain attack of this sophistication from the top of my head

@GossiTheDog "look Ma I‘m on TV" got a laugh out of me, I admit
What's new for the Microsoft C++ docs

A list of new articles and doc updates for the Microsoft C/C++ compiler, ATL/MFC, C runtime, and standard library docs.

@fuomag9 @GossiTheDog no, it's actually harmless

The PR he made can be found here: https://github.com/MicrosoftDocs/cpp-docs/pull/4716/files
No code change, just documentation

Update C Runtime Library Compatibility page. by JiaT75 · Pull Request #4716 · MicrosoftDocs/cpp-docs

Fixes #4715

GitHub

@GossiTheDog

How long before the numpties begin combining this with their Baltimore bridge cyber conspiracy theories?

@GossiTheDog @jaark please don’t give them ideas.

@GossiTheDog @AndresFreundTec

"Oops, I just stopped a massive operation that could have brought down everything under the sun, accidentally." *flexes*

@GossiTheDog I'm sure the FBI will thank him in their traditional fashion for cyber security saviours

@GossiTheDog indeed we do.

This exploit was carefully aimed at Linux using systemd launched SSH. We non Linux folks can breathe a hair easier but who knows what else is going on. Don't panic but definitely be cautious.

@GossiTheDog That specific dev contributed to wasmtime etc too. So more projects need audits.
@GossiTheDog We're incredibly lucky that it wasn't more sophisticated, or it may have gone unnoticed for a long time.
@emaste @GossiTheDog Pretty wild that the implication is that this particular backdoor was only caught because it was coded badly enough to have a significant performance impact. What if it’d been better written, I wonder?