Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Upstream compromised? Or is the compromise? #92

Closed
alerque opened this issue Mar 29, 2024 · 76 comments
Closed

[Bug]: Upstream compromised? Or is the compromise? #92

alerque opened this issue Mar 29, 2024 · 76 comments
Labels
bug Something isn't working

Comments

@alerque
Copy link

alerque commented Mar 29, 2024

I understand why the author(s) of the analysis of the backdoor being distributed by this project decided not to notify upstream first since it looks like either the upstream is the compromise or at least are compromised themselves, so reporting here first would have done nothing except give the culprit time to wiggle. But the cat is out of the bag now and I see comments all over the place pinging the author. I think it's high time a bug report here notifies people following this tracker there is an issue. Also this serves as a request for a postmortem. Either this project has members that are bad actors or the members have themselves been deeply compromised. Most evidence seems to support the former. If there is evidence of the latter I suggest getting it out there post-haste.

@nickodell
Copy link

Some more resources about this:

Red Hat has published a security advisory about this: https://nvd.nist.gov/vuln/detail/CVE-2024-3094

Xe Iaso has an excellent blog post about this: https://xeiaso.net/notes/2024/xz-vuln/

Debian has released a security advisory about this: https://lists.debian.org/debian-security-announce/2024/msg00057.html Users of testing, unstable and experimental are advised to update. Users of stable distributions are unaffected.

Ubuntu has not made an announcement, but I believe they are unaffected: the newest liblzma they ship is 5.4.1.

@FabioPedretti
Copy link

Ubuntu published 5.6 in proposed for some time, then it looks like it was reverted:
https://bugs.launchpad.net/ubuntu/+source/xz-utils/+bug/2055422
Now they are syncing 5.6.1+really5.4.5-1 to make sure you get safer 5.4, even if you installed 5.6 the days it was in proposed:
https://launchpad.net/ubuntu/+source/xz-utils

@alerque
Copy link
Author

alerque commented Mar 29, 2024

This comment on Hacker News suggests very heavily the OP is and was a bad actor for a long time. All things considered it definitely sounds like deep review of lots of things (linked binaries, kernel, containers, etc.) is going to be needed and simply rolling back one release might not be enough.

@rubyFeedback
Copy link

I think having some kind of blog or text-response may be useful, because after reading:

https://lwn.net/ml/oss-security/20240329155126.kjjfduxw2yrlxgzm@awork3.anarazel.de/

I am confused whether I am possibly affected. I assume no, because I do not use debian,
and compile from the released tarballs (source archive) here from github, but even then
it may be useful for the xz project to make a few comments (unless that has already
happened, but in this case I don't quite know where to read up on this).

gastonmorixe referenced this issue Mar 29, 2024
The original files were generated with random local to my machine.
To better reproduce these files in the future, a constant seed was used
to recreate these files.
@alerque
Copy link
Author

alerque commented Mar 29, 2024

This comment on Hacker News has some loose ends of a paper trail pointing not just to @JiaT75 but also @hansjans162 as likely being involved (or possibly an alias of the same actor?). Lots more rabbit holes to go down to root out the mess...

@nickodell
Copy link

nickodell commented Mar 29, 2024

@rubyFeedback

I think having some kind of blog or text-response may be useful, because after reading:

https://lwn.net/ml/oss-security/20240329155126.kjjfduxw2yrlxgzm@awork3.anarazel.de/

I am confused whether I am possibly affected. I assume no, because I do not use debian, and compile from the released tarballs (source archive) here from github, but even then it may be useful for the xz project to make a few comments (unless that has already happened, but in this case I don't quite know where to read up on this).

It depends on how exactly you downloaded the file. If you went onto the Releases page and downloaded the tarball, then you have the vulnerability. You can see this by opening one of the tar files, and opening m4/build-to-host, and looking at line 63, which is the same line that the openwall announcement says is part of the backdoor.

On the other hand, if you went to the home page, and you clicked on a tag, then clicked "download zip," then you got the files that are in Git, which are different than the release tarball. You would not be affected by the vulnerability in that case. (Unless there is some other backdoor that we haven't found yet.)

@alerque
Copy link
Author

alerque commented Mar 29, 2024

Following up on @nickodell, some of the exploit code has been checked into Git and around for much longer than the latest releases, but just stashed in an obfuscated and compressed file that (according to current preliminary analysis) wasn't getting activated until recently. The code to trigger the exploit code was only added in the release tarball and gated behind various conditions.

That doesn't mean other malicious things didn't happen in the past and deeper analysis is still being worked on to see if other triggers might have been present. The presently known and understood trigger was only recently activated and added to the tarballs.

@scy
Copy link

scy commented Mar 29, 2024

you all could start by removing all binary files from this repo, binary files don't belong on git.

I'd say, if you're a compression library, it makes a lot of sense to have binary files containing compressed data in the repo, as part of your test suite. Which is what happened here.

@AdnaneKhan
Copy link

AdnaneKhan commented Mar 29, 2024

Following up on @nickodell, some of the exploit code has been checked into Git and around for much longer than the latest releases, but just stashed in an obfuscated and compressed file that (according to current preliminary analysis) wasn't getting activated until recently. The code to trigger the exploit code was only added in the release tarball and gated behind various conditions.

That doesn't mean other malicious things didn't happen in the past and deeper analysis is still being worked on to see if other triggers might have been present. The presently known and understood trigger was only recently activated and added to the tarballs.

They even added that file to the .gitignore (4323bc3). I wonder if the compressed files also placed that file so if you ran tests and built from source you would still get the exploit.

@nickodell maybe there is another backdoor.

@sfalken
Copy link

sfalken commented Mar 29, 2024

openSUSE has also made their announcement.

https://news.opensuse.org/2024/03/29/xz-backdoor/

@Alcaro
Copy link

Alcaro commented Mar 29, 2024

you all could start by removing all binary files from this repo, binary files don't belong on git.

I'd say, if you're a compression library, it makes a lot of sense to have binary files containing compressed data in the repo, as part of your test suite. Which is what happened here.

Binary files containing compressed data make sense.

35KB binary files containing compressed data, that decompress to apparent nonsense and have no documentation on how they were created, do not make sense.

@P-EB
Copy link

P-EB commented Mar 29, 2024

I'd be happy to understand why @Larhzu didn't react yet.

@vielmetti
Copy link

CVE-2024-3094 is the CVE for this (and that should link to the Github internal page for this, let's see)

@lietu
Copy link

lietu commented Mar 29, 2024

I'd be happy to understand why @Larhzu didn't react yet.

Well, it is a national holiday in Finland, and late on a Friday. Some chance they're just out drinking.

@scy
Copy link

scy commented Mar 29, 2024

Binary files containing compressed data make sense.

35KB binary files containing compressed data, that decompress to apparent nonsense and have no documentation on how they were created, do not make sense.

I agree. I was mainly responding to @capicy's overly general statement of "binary files don't belong on git".

@femboywiki
Copy link

Does anyone have any information concerning the threat actor such as his identity or country of origin?

@lietu
Copy link

lietu commented Mar 29, 2024

Does anyone have any information concerning the threat actor such as his identity or country of origin?

From the sound of it, seems like a fake identity. Unlikely even GitHub can easily find out.

@ddvarpdd
Copy link

Arch Linux has also made an announcement.

@ddvarpdd
This comment was marked as a violation of GitHub Acceptable Use Policies
@imadnyc
Copy link

imadnyc commented Mar 29, 2024

@ddvarpdd This being a severe backdoor doesn't excuse racism.

@Alcaro
Copy link

Alcaro commented Mar 29, 2024

Arch Linux has also made an announcement.

https://security.archlinux.org/ASA-202403-1

The problem has been fixed upstream in version 5.6.1.

Considering upstream version 5.6.1 was released three weeks ago, I must say I find that statement rather strange.

e: Fixed at https://gitlab.archlinux.org/archlinux/packaging/packages/xz/-/commit/881385757abdc39d3cfea1c3e34ec09f637424ad , by using the Git release rather than Github. Good job with the embargo, that is a thorougly unsuspicious commit that nevertheless does fix the issue.

@Asday
Copy link

Asday commented Mar 29, 2024

@ddvarpdd it's worth looking into what a "false flag" is.

@zb3
Copy link

zb3 commented Mar 29, 2024

I suspect @JiaT75 just wanted to stay alive.. I hope this is the case.

@imide
Copy link

imide commented Mar 29, 2024

https://archlinux.org/news/the-xz-package-has-been-backdoored/

they made a main website announcement. seems like arch cant be backdoored? i am a moron however

@AffSeda
Copy link

AffSeda commented Mar 29, 2024

The scope is probably quite limited, but as Homebrew has rolled the package back just in case; I would update Brew. Although systemd isn't there, glibc does exist on Brew and might be present.

@ShePastAway0
Copy link

ShePastAway0 commented Mar 29, 2024

The scope is probably quite limited, but as Homebrew has rolled the package back just in case; I would update Brew.

could you please elaborate on the scope? and what is the point of updating brew itself instead of removing/downgrading the package? the main question if it was possible to affect Mac Silicons via this "bug", as far as i understand it was some kind of shellcode triggering hence it must be only x86_x64 targeted, correct me if im wrong please

@skull-squadron
Copy link

Without adding fuel to the fire, this is a good reminder about discretion in trust, vigilance, and security practices in F{L,}OSS dev and packaging. Recall also ProFTPD, OpenBSD, PyPi, rest-client.

In the future, it would be useful for researchers and laypeople to submit SHA256, etc. hashes of known good and known bad artifacts to make tracing simpler.

Cheers peeps and best wishes for cleanup and recovery. xz is a core package to FLOSS.

@AffSeda
Copy link

AffSeda commented Mar 29, 2024

Sorry, I meant update brew in the sense of "update the package you have installed on brew" which will actually result in a downgrade. You can view their report here:
https://github.com/orgs/Homebrew/discussions/5243

I'm afraid I do not have the expertise to speculate on the answers to your questions, so I'm going with the option provided by Homebrew maintainers. They do not believe theirs was affected.

@DanielRuf
Copy link

@DanielRuf
Copy link

DanielRuf commented Mar 29, 2024

The code checks for linux and x86-64 as architecture according to Andres Freund (see https://www.openwall.com/lists/oss-security/2024/03/29/4).

Apple has a different architecture.

@BurningEnlightenment
Copy link

BurningEnlightenment commented Mar 29, 2024

@ShePastAway0 The backdoor which has been found is quite sophisticated and relies on a prebuilt object file shipped as part of test files with this repository. As far as I am aware this object file is built for x86_64 and no other payloads have been found at the time of writing. However, it is not inconceivable that other attack vectors have been introduced in the past year--it will take more time to fully audit the changes made in the past year, e.g. we might find something like the the suspicious libarchive PR. A conservative approach would be to revert back to the last release made by Lasse Collins himself.

@Midek

This comment was marked as abuse.

@Tejeev
Copy link

Tejeev commented Mar 29, 2024

@Midek, hopefully you're knowledgeable in infosec and just joking, but if not, you may want to look up what a false flag is. There are a lot of malicious actors out there, and folks who are quick to point fingers are the easiest to manipulate. If someone were trying to hide their tracks, planting a few false flags like making sure they committed at a similar time window each time, would be too easy a step for them to not take. Especially someone smart and dedicated enough to do this.

@cwegener
Copy link

cwegener commented Mar 29, 2024

Does anyone have any information concerning the threat actor such as his identity or country of origin?

Commit history shows timezone to be UTC+8, so likely a chink.

I have no clue what you are trying to say, but on the off chance that you are not in the world of software engineering, here is a screenshot of me making a git commit with UTC+8 (note on the top right, my local time is UTC+11)

image

@Hakkin
Copy link

Hakkin commented Mar 29, 2024

Lasse doesn't appear to be involved: https://www.mail-archive.com/xz-devel@tukaani.org/msg00567.html

It's interesting to note that the "Jigar Kumar" in this thread that is pressuring Lasse to find a replacement maintainer has the same e-mail format (<firstname><lastname><number>) as the "Hans Jansen" e-mail that was part of the backdoored commits. The PGP key for the Protonmail account (0xA97B6FC34F5DB756) was created on 2022-04-26, and the first message by "Jigar Kumar" on the xz-devel mailing list was on 2022-04-27, one day later.

It's seeming increasingly likely that every step of this process was carefully orchestrated by multiple sockpuppet accounts controlled by the same actor.

@alanc
Copy link

alanc commented Mar 29, 2024

I'd be happy to understand why @Larhzu didn't react yet.

It appears github has suspended the accounts of both project maintainers, but this is only shown in their entries in the "following" lists of accounts who follow them, not their main profiles:

@cwegener
Copy link

This issue should probably be locked

Locked by who though?

@alerque
Copy link
Author

alerque commented Mar 29, 2024

@alanc Interesting find. Hans' account is also suspended. Somebody at GH probably has access (and possibly soon a legal mandate) to look into PII on those accounts and correlate activity.

@P-EB
Copy link

P-EB commented Mar 29, 2024

I'd be happy to understand why @Larhzu didn't react yet.

It appears github has suspended the accounts of both project maintainers, but this is only shown in their entries in the "following" lists of accounts who follow them, not their main profiles:

* https://github.com/JiaT75?tab=following

* https://github.com/Larhzu?tab=following

Ah this UI is really horrible. Thanks for finding out.

That being said, a mail on oss-security would be a good start.

@Asday
Copy link

Asday commented Mar 29, 2024

That being said, a mail on oss-security would be a good start.

https://www.openwall.com/lists/oss-security/2024/03/29/4 Like this one?

Am I misunderstanding what "oss-security" is?

@P-EB
Copy link

P-EB commented Mar 29, 2024

https://www.openwall.com/lists/oss-security/2024/03/29/4 Like this one?

No. From Lasse.

@Asday
Copy link

Asday commented Mar 29, 2024

Lasse regularly has internet breaks and is on one at the moment, started before this all kicked off.
We believe CISA may be trying to get in contact with him.

@mirabilos
Copy link

Debian is currently looking into downgrading it even further, before the first contribution from the known bad actor, which may be an older 5.2 release (later ones were also cut by them), then reapplying only the security fixes that came later on top manually, for now.

@medicalwei
Copy link

Is it safe to keep discussions here where their maintainers have delete access to the whole thread? I worry they may drop the discussion or repo.

@colleirose

This comment was marked as spam.

@AffSeda
Copy link

AffSeda commented Mar 30, 2024

I'm pretty sure the maintainers are both suspended and can't do anything.

@colleirose

This comment was marked as spam.

@rugk
Copy link

rugk commented Mar 30, 2024

Also there is archive.org.

@junaruga
Copy link

junaruga commented Mar 30, 2024

Also there is archive.org.

Nice! The link below is maybe better to see the updated archives.
https://web.archive.org/web/20240000000000*/https://github.com/tukaani-project/xz/issues/92

@thesamesam
Copy link
Member

I'm going to close this for now. There's a huge amount of comments and speculation and it's not really actionable in terms of technical items to work on other than the obvious.

I may start a new issue with a checklist of what is to be done to decontaminate things.

If you need information on the incident, please see https://tukaani.org/xz-backdoor/.

@thesamesam thesamesam closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests