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

Revert [liblzma] update to version 5.6.0 (#37199) #37841

Merged
merged 1 commit into from Mar 30, 2024

Conversation

BillyONeal
Copy link
Member

@BillyONeal BillyONeal commented Mar 29, 2024

Resolves #37839
Reverts #37199

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

Note that the version database is unmodified, only the baseline is changed.

Because vcpkg builds liblzma from cmake sources downloaded from github and this backdoor required modifications only present in the release tarballs, it is our belief that vcpkg customers are not affected by this problem. However, we are reverting this version out of an abundance of caution as the threat actor clearly has broad access to liblzma infrastructure, and because we believe customers will start flagging this package by version as being a problem.

@BillyONeal BillyONeal added category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. labels Mar 29, 2024
@BurningEnlightenment
Copy link
Contributor

Please note that the malicious actor has also been responsible for quite a few earlier xz releases including 5.4.4 and contributed somewhat suspicious PRs against libarchive, so it might be prudent to take a closer look at 5.4.4 or revert to an even older release still made by Lasse Collin (even though the ifunc "infrastructure" for the backdoor has only been introduced in version 5.5.x).

@@ -42,7 +41,7 @@ set(exec_prefix "\${prefix}")
set(libdir "\${prefix}/lib")
set(includedir "\${prefix}/include")
set(PACKAGE_URL https://tukaani.org/xz/)
set(PACKAGE_VERSION "${VERSION}")
set(PACKAGE_VERSION 5.4.3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw. this mismatches with the actually installed version 5.4.4

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true; I'm trying to keep the same git-tree here though. Will look at fixing that after this lands

@carsten-grimm
Copy link
Contributor

carsten-grimm commented Mar 30, 2024

Oh dear. Was there anything that I could have done to spot this?

@Neustradamus, as the one requesting the update, you might be affected by this.

Edit: For clarification, I am not casting blame on @Neustradamus here for requesting the update. That would be silly. I am mentioning them as I am worried that they might need to take measures to protect themselves from the backdoor.

@VelocityRa
Copy link
Contributor

VelocityRa commented Mar 30, 2024

Their repo's down - no versions of the port work now.
image
Sorry for posting here but I suppose a new issue here for this wouldn't be appropriate either.

Does anyone know what's going on, did GitHub themselves do it or if not, have they made any announcements on when they'll put it back up?

@marekr
Copy link
Contributor

marekr commented Mar 30, 2024

Yea GitHub has probably just broken many many many many things by doing something that rash.

I imagine every Linux distro is now unable to build lol.

Libxz is not a small time dependency. Vcpkg will now have to keep its own source copy somewhere.

@carsten-grimm
Copy link
Contributor

Yea GitHub has probably just broken many many many many things by doing something that rash.

They must have had very good reasons. If I had distributed software with an affected version of liblzma, I would now be unable to distribute an update with an unaffected version.

@marekr
Copy link
Contributor

marekr commented Mar 30, 2024

Yea GitHub has probably just broken many many many many things by doing something that rash.

They must have had very good reasons. If I had distributed software with an affected version of liblzma, I would now be unable to distribute an update with an unaffected version.

And now they are about to have a few thousand forks of liblzma on github with no forking history because people are copying https://git.tukaani.org/xz.git and backing it up got github to get their build systems going.

@gastonmorixe
Copy link

gastonmorixe commented Mar 30, 2024

Before it got down I git cloned it (from github): https://github.com/gastonmorixe/xz
Hope it helps

@carsten-grimm
Copy link
Contributor

carsten-grimm commented Mar 30, 2024

Before it got down I git cloned it: https://github.com/gastonmorixe/xz Hope it helps

This appears to be version 5.6.1 that contains the backdoor. I do not see any measures to remove it. This might be harmful. You might at the very least want to at least revert all changes since the last version that is known not to be affected.

@gastonmorixe
Copy link

Before it got down I git cloned it: https://github.com/gastonmorixe/xz Hope it helps

This appears to be version 5.6.1 that contains the backdoor. I do not see any measures to remove it. This might be harmful. You might at the very least want to at least revert all changes since the last version that is known not to be affected.

Well I wrote in the repo description that it is a backup. It's for researchers and that's why I published here so it helps.

I personally reported the authors of the vulnerability on GitHub but I don't agree with Github action of completely taking it down, there was a lot of constructive discussion and it's all gone.

@BillyONeal
Copy link
Member Author

Oh dear. Was there anything that I could have done to spot this?

I don't think so. Clearly they got into Debian and Fedora and SUSE and a few other things too.

Our stance has always been that we give you what upstream gives you. There's really no defense from upstream becoming malicious.

@BillyONeal
Copy link
Member Author

Yea GitHub has probably just broken many many many many things by doing something that rash.

It's hard decision to choose between breaking people or continuing to distribute malicious code. I would have made the same one.

@gamer191
Copy link

gamer191 commented Mar 30, 2024

It's hard decision to choose between breaking people or continuing to distribute malicious code. I would have made the same one.

I think they should have reverted it (to the last safe commit), but I guess that's probably not possible

@gamer191
Copy link

This appears to be version 5.6.1 that contains the backdoor. I do not see any measures to remove it. This might be harmful. You might at the very least want to at least revert all changes since the last version that is known not to be affected.

My understanding (based partially on Alpine Linux's patch) is that it should be fine, because only half of the backdoor was actually committed, and the other half was injected into the official tarballs (which that repo isn't distributing)

Oh dear. Was there anything that I could have done to spot this?

XZ is very widely used. It's absolutely not your job to audit every update. Literally none of the package maintainers noticed it, it was accidentally spotted by someone doing some benchmarking

@benine203 benine203 mentioned this pull request Mar 30, 2024
@MichaelCurrie
Copy link

This PR doesn't seem to work. When I run:

.\vcpkg install liblzma:x64-windows

I get this error, which is still pointing to the disabled tukaani-project/xz repository, so the URL fails to load.

Installing 3/3 liblzma:x64-windows@5.4.4...
Building liblzma:x64-windows@5.4.4...
-- Downloading https://github.com/tukaani-project/xz/archive/v5.4.4.tar.gz -> tukaani-project-xz-v5.4.4.tar.gz...
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Trying to load bundleconfig from C:\Users\Michael Currie\Desktop\GitHub\vcpkg\vcpkg-bundle.json
[DEBUG] Failed to open: C:\Users\Michael Currie\Desktop\GitHub\vcpkg\vcpkg-bundle.json
[DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt
[DEBUG] Metrics enabled.
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Feature flag 'dependencygraph' unset
Downloading https://github.com/tukaani-project/xz/archive/v5.4.4.tar.gz
[DEBUG] Trying to hash C:\Users\Michael Currie\Desktop\GitHub\vcpkg\downloads\tukaani-project-xz-v5.4.4.tar.gz.25804.part
[DEBUG] C:\Users\Michael Currie\Desktop\GitHub\vcpkg\downloads\tukaani-project-xz-v5.4.4.tar.gz.25804.part has hash bfa7f2e34fcd3deb64e3496e6dedf8e2172e0a9ad7c48b9e1a187100dcd5a54be7021e42cd6fc37a4d6e088fc6ed9137941d84b670300bc7390b9af648d7f18e
error: Failed to download from mirror set
error: File does not have the expected hash:
url: https://github.com/tukaani-project/xz/archive/v5.4.4.tar.gz
File: C:\Users\Michael Currie\Desktop\GitHub\vcpkg\downloads\tukaani-project-xz-v5.4.4.tar.gz.25804.part
Expected hash: c28461123562564e030f3f733f078bc4c840e87598d9f4b718d4bca639120d8133f969c45d7bdc62f33f081d789ec0f14a1791fb7da18515682bfe3c0c7362e0
Actual hash: bfa7f2e34fcd3deb64e3496e6dedf8e2172e0a9ad7c48b9e1a187100dcd5a54be7021e42cd6fc37a4d6e088fc6ed9137941d84b670300bc7390b9af648d7f18e

@BillyONeal BillyONeal merged commit ce19164 into microsoft:master Mar 30, 2024
16 checks passed
@MichaelCurrie
Copy link

@BillyONeal I think you should reference this mirror

https://github.com/bminor/xz/archive/refs/tags/v5.4.4.tar.gz

rather than the original repo

https://github.com/tukaani-project/xz/archive/v5.4.4.tar.gz

which has been disabled by GitHub.

@Neustradamus
Copy link

@BillyONeal
Copy link
Member Author

I get this error, which is still pointing to the disabled tukaani-project/xz repository, so the URL fails to load.

This PR does not attempt to change the source from github to anything else, it just changes it to not try to grab the known vulnerable one.

We don't have a path forward for a canonical source at this time.

@BillyONeal BillyONeal deleted the revert-liblzma branch March 30, 2024 10:35
@MichaelCurrie
Copy link

@BillyONeal agreed but for anyone who just wants to get their build working again, please make the following one-liner change:

image

@Neustradamus
Copy link

Neustradamus commented Mar 30, 2024

Warning, some people attack me because I have requested the XZ update.
I am not linked to the XZ project.

Linked to:

@carsten-grimm
Copy link
Contributor

carsten-grimm commented Mar 30, 2024

Warning, some people attack me because I have requested the XZ update. I am not linked to the XZ project.

@Neustradamus I hope you did not mistake my mention of you as an attack. It was never meant as such and I am sorry, if you felt that way. I was/am worried that you might be affected by the backdoor and need to take measures on your end.

If you meant that somebody else was attacking you, then that is just silly. They might as well attack me for updating the version here without noticing a backdoor.

@BA7LYA
Copy link

BA7LYA commented Mar 30, 2024

@BillyONeal agreed but for anyone who just wants to get their build working again, please make the following one-liner change:

image

As far as i know, the official git https://git.tukaani.org/ still works.

@stevecotton
Copy link

As far as i know, the official git [URL REMOVED] still works.

... but shouldn't be trusted in this case.

@Neustradamus
Copy link

Neustradamus commented Mar 30, 2024

The official XZ team announcement is here:

Important to know: There is no problem with contributors here like @carsten-grimm.

But several people mix all because I have requested the XZ update in vcpkg.
I have received a lot of bad messages (private and public).
I have no link with XZ project, I follow only the project and do announcement or/and update requests.
I have requested 5.4.5 and 5.6.0 because there was only 5.4.4 in vcpkg.

@gowthamgts has participated on HN against me badly and I have commented on two places where he has commented (on my SCRAM request publications):

You can look here the original comment:

You can follow my announcements here:

The good point, people speak about SCRAM "Salted Challenge Response Authentication Mechanism" security ;)

Badly, some people or projects like only old unsecure mechanisms, some would like security improvements.

@dg0yt
Copy link
Contributor

dg0yt commented Mar 30, 2024

As far as i know, the official git [URL REMOVED] still works.

However, we don't know if it has the load balancing to feed everybody's CI.

@Hyrtsi
Copy link

Hyrtsi commented Apr 3, 2024

@BillyONeal agreed but for anyone who just wants to get their build working again, please make the following one-liner change:

image

This didn't work for me. However, when I added this to my top level vcpkg.json manifest the issue was resolved:

  "overrides":[
    {"name": "liblzma", "version": "5.4.0"}
  ]

@Mike4Online
Copy link

Mike4Online commented Apr 9, 2024

Commits were made today, April 9, to the xz.git repository on the Tukaani website to remove the files responsible for the xz backdoor. See the shortlog and this commit.

A new tag (release) has not yet been posted. According to the xz backdoor status page on the Takaani site:

xz.git needs to be gotten to a state where I’m happy to say I fully approve its contents. It’s possible that the recent commits in master will be rebased to purge the malicious files from the Git history so that people don’t download them in any form when they clone the repo. The old repository could still be preserved in a separate read-only repository for history: the contents of its last commit could equal some commit in the new repository.

These will unfortunately but obviously take several days.

A clean XZ Utils release version could jump to 5.8.0. Some wish that it clearly separates the clean one from the bad 5.6.x.

@Neustradamus
Copy link

The GitHub repository has done a comeback too:

Note that there are 5.4.5 (2023-11-01) and 5.4.6 (2024-01-26) release builds too:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[liblzma] port uses compromised version