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.

Also, to be super clear nobody should panic about #XZ as the Postgres developer who found this basically caught it quick enough that almost no businesses or devices will be running the code.

So everybody should be chill about this specific issue as that guy saved everybody’s bacon.

To give an idea of the scale of OpenSSH usage, it’s absolutely huge, it dwarfs RDP by a huge margin (think ten times), and had this survived for a long period of time it would have been unbelievably bad.

The sshd backdoor in #XZ is just way beyond my technical ability. There’s so much there, I imagine more than a few conference talks are going to be submitted for it.

My amateur hour view is it’s really well put together (eg you can only execute commands if you have a private key that only the attacker has) and appears to allow remote removal of the backdoor, too. There’s a whole bunch of features which I’m too dumb to get.

Also for me, performance isn’t that bad - I wouldn’t have noticed it.

Kinda interesting - a change made by the threat actor has ended up in Windows OS. Redmond bundled libarchive into the OS, which the TA had been tinkering with.

This is the code change which has been imported: https://github.com/libarchive/libarchive/pull/1609

Edit: reworded this as the scope looks bigger than Win 11.

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
I gotta say, the open source community response to the XZ issue and auditing code changes for the specific threat actor has been incredibly good overall.

4 days since XZ backdoor became public knowledge and most major Linux AV and EDR security vendors still have zero detections.. they haven’t even set the static file hashes as malicious.

Can’t wait for all the vendor blogs in a week saying they fully protect against the threat. 👍

@GossiTheDog isn't windows kind of a giant backdoor anyways with all the telemetry - i mean all os do it but i think windows is pretty active in this area. the story keeps growing to some extent - good qa by open source community in general

@GossiTheDog This is a pretty big wakeup call, to be honest.

I also wonder if they've managed to sneak in other code that has NOT been caught yet.

@GossiTheDog somewhere if this is true it would be somewhat funny and hopefully would put a stop to the whole 'opensource vs closed source security' debate

@GossiTheDog I think this was for the BSD tar executable, so you have to run the code deliberately:

C:\>tar.exe --version
bsdtar 3.6.2 - libarchive 3.6.2 zlib/1.2.5.f-ipp liblzma/5.2.5 bz2lib/1.0.8 libzstd/1.5.4

@GossiTheDog And we only know that because they re-used accounts/names for both code submissions, right?

That's a disturbing thought.

@GossiTheDog Well, Windows (at least 10) has tar. You could try Tavis' exploit. You'll have to do it in Terminal, though; I don't think that conhost (i.e., running CMD.EXE directly) supports ANSI sequences right off the bat. I remember having to do some magic when using those there.
@GossiTheDog It seems like deep supply chain attacks like this are going to be the thing for a while. This whole business is just totally depressing.
@GossiTheDog Damn, if it’s beyond your technical ability, a guy like me wouldn’t have a chance. I’m glad our servers here aren’t using the exploited version, but the thought is terrifying.
@GossiTheDog It's just half a second slower than normal. You won't notice it with a single login. The guy who discovered it noticed it because thousands of computers on the Internet knocking on his SSH door caused noticeable performance degradation.
@GossiTheDog but we shoud maybe panic at the number of other projects that may have been infiltrated by this actor under other names and have never beeen noticed?
@renchap @GossiTheDog that was also my question. If it happened with XZ, where else has it happened before?
@renchap @GossiTheDog GitHub had better be analyzing correlations with other user account activity and flagging any matches for review...
@GossiTheDog yeah, it could have run circles around EternalBlue if it was really deployed.
@GossiTheDog Is my understanding correct that from our current knowledge blocking access to sshd would prevent exploitation?
@sheogorath @GossiTheDog i saw a couple of people saying that the exploit is too obfuscated/complex to say that only sshd would be affected with confidence, yet.

@sheogorath @GossiTheDog ok. debian seems to be "confident enough" now 😁

https://fulda.social/@Ganneff/112190322996404954

Joerg Jaspert :debian: (@[email protected])

@[email protected] @[email protected] Confident enough.

Fulda.social
@GossiTheDog @theruran On top of that, for any given vuln, most vulnerable systems don’t expose it to the outside world. That’s not to say we shouldn’t address those vulns— we absolutely should —but we don’t need to panic about it.
@GossiTheDog Not very chill here 😱. IMHO just pure dumb luck prevented a nuke-equivalent exploding below our arses.
@GossiTheDog the attempt to get it into ubuntu 24.04 lts is the spooky part to me, that would have been a catastrophe if they got it in and then sat on it for a year. Kudos to the fedora and ubuntu maintainers for being suspicious about the urgency.
@GossiTheDog would you be willing to venture that this removes all non-nation state actors given the complexity?

@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 :)

@0daystolive @GossiTheDog @SamantazFox

Blush. OK. Then the criminal charges are hereby reduced to a mere misdemeanor: use of confusing jargon. A few weeks of community service will do.

@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 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 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