xz backdoored, if you use homebrew upgrade immediately

Maarten

Ars Tribunus Militum
1,830
Subscriptor++
In this Linux Kung Fu thread there is a report for this, but this applies to the Mac as well if you use homebrew. Please run brew update; brew upgrade immediately if you have homebrew installed. This will downgrade the xz and the lzma library to a version that is not backdoored.

If you have other package managers, please add below what action you took. As far as I know there is no xz tool installed by default on macOS.
 

kenada

Ars Legatus Legionis
17,281
Subscriptor
The exploit doesn’t work on macOS (as far it’s known). It relies on Linux and glibc-specific functionality to replace functions called by openssh, it only supports x86_64, and it also only injects the backdoor when it detects that it’s building for certain Linux distributions.

If you have other package managers, please add below what action you took. As far as I know there is no xz tool installed by default on macOS.
For those using nixpkgs on Darwin: nixpkgs 23.11 is not affected; nixpkgs unstable has the vulnerable version, but it’s unlikely that the exploit works because nixpkgs does not link openssh to liblzma (even indirectly), and the exploit’s path checks for sshd fail because it’s in the store not at the usual path. Also, Darwin. Regardless, xz was reverted to 5.4.6 earlier today. It should show up in unstable after the current staging-next cycle completes (probably in a week or two since the reversion caused mass rebuilds).

https://discourse.nixos.org/t/cve-2024-3094-malicious-code-in-xz-5-6-0-and-5-6-1-tarballs/42405
If you have other package managers, please add below what action you took. As far as I know there is no xz tool installed by default on macOS.
Apple ships liblzma but not xz. I dumped the dyld cache on macOS 14.4.1 and grepped for version strings. I get 5.4.3.
 
Last edited:
  • Like
Reactions: MrFry

MrFry

Smack-Fu Master, in training
1
brew uninstall --zap "xz" Error: Refusing to uninstall /opt/homebrew/Cellar/xz/5.4.6 because it is required by aom, borgbackup, curl, ffmpeg, gallery-dl, gcc, gdk-pixbuf, ghostscript, glib, glib-networking, gobject-introspection, gsettings-desktop-schemas, harfbuzz, imagemagick, jpeg-xl, leptonica, libarchive, libheif, libmediainfo, libraw, librsvg, libtiff, little-cms2, mat2, media-info, megatools, numpy, openblas, openjpeg, openvino, poppler, pygobject3, python@3.12, rsync, tesseract, webp, yt-dlp and zstd, which are currently installed. You can override this and force removal with: brew uninstall --ignore-dependencies xz

I use lots of tools that depend on "xz".
Am I really not affected as macOS user with Linux servers.
 

dal20402

Ars Tribunus Angusticlavius
7,341
Subscriptor++
Using MacPorts on my AS machine because it gives me a more or less usable AS version of qgis3.

Just did a port upgrade outdated and, after running it, found that the active version of xz was 5.4.6. Maybe I just failed to update during the right time period, but it doesn't appear that MacPorts ever installed 5.6.0 or 5.6.1 on my system.