brew install xz installs the outdated version 5.4.6 instead of 5.6.1 #5243
-
Output of
|
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 30 replies
-
This is intentional as 5.6.x is untrusted: https://www.bleepingcomputer.com/news/security/red-hat-warns-of-backdoor-in-xz-tools-used-by-most-linux-distros/ (see https://www.openwall.com/lists/oss-security/2024/03/29/4 for technical details) To be clear: we don't believe Homebrew's builds were compromised (the backdoor only applied to deb and rpm builds) but 5.6.x is being treated as no longer trustworthy and as a precaution we are forcing downgrades to 5.4.6. |
Beta Was this translation helpful? Give feedback.
-
thank You! |
Beta Was this translation helpful? Give feedback.
-
Question: Shouldn't the dangerous After PROMPT> ls -l ~/Library/caches/homebrew | grep xz
lrwxr-xr-x 1 neoneye staff 112 Mar 30 00:37 xz--5.4.6 -> downloads/a8def111ef35d2c9d46e56ff2c6c7b623b61be0f395014454e9f11db2db16981--xz--5.4.6.arm64_sonoma.bottle.tar.gz
lrwxr-xr-x 1 neoneye staff 112 Mar 12 21:29 xz--5.6.1 -> downloads/0e0aec6661183ecb640ab65fdea4d5387cd8029dbe702b0b4801030e148df690--xz--5.6.1.arm64_sonoma.bottle.tar.gz
lrwxr-xr-x 1 neoneye staff 105 Mar 30 00:37 xz_bottle_manifest--5.4.6 -> downloads/b2cc4077807c100af6e0253f51d186f187ff55165638cbe3a4aa16d1c4762660--xz-5.4.6.bottle_manifest.json
lrwxr-xr-x 1 neoneye staff 105 Mar 12 21:31 xz_bottle_manifest--5.6.1 -> downloads/bc72ad1aed6fc861afaf3fd0af8266ea2913cb871cfdcbeef0c228afb9826c72--xz-5.6.1.bottle_manifest.json After the PROMPT> xz --version
xz (XZ Utils) 5.4.6
liblzma 5.4.6 My config PROMPT> brew config
HOMEBREW_VERSION: 4.2.15
ORIGIN: https://github.com/Homebrew/brew
HEAD: 92a4311868322188478d7a90511ec0e8e6b0d7df
Last commit: 5 days ago
Core tap JSON: 29 Mar 23:36 UTC
Core cask tap JSON: 29 Mar 23:36 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: /Users/neoneye/bin/mate -w
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 14.1.2-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.3
Rosetta 2: false |
Beta Was this translation helpful? Give feedback.
-
brew info xz 这些命令跑完基本就回退了 |
Beta Was this translation helpful? Give feedback.
-
Downgrading xz (compiled, not bottled) on unsupported macOS 11 Big Sur - Seems to workbrew update
brew info xz
brew cleanup xz --prune=0
brew reinstall xz
brew cleanup
brew info xz
xz --version
|
Beta Was this translation helpful? Give feedback.
-
thanks @porg |
Beta Was this translation helpful? Give feedback.
-
This is still referencing the compromised subdoman xz.tukaani.org which the attacker Jia Tan controls. The original URL was tukaani.org/xz which was controlled by Lasse Collin. Here's his message confirming that the attacker controlled the xz subdomain: https://tukaani.org/xz-backdoor/ Here's the attacker asking oss-fuzz to change the url from tukaani.org/xz to xz.tukaani.org: https://twitter.com/WhichbufferArda/status/1773829481645457798 |
Beta Was this translation helpful? Give feedback.
-
Meanwhile I think there's a little audit proof which can be done via macOS Terminal: { find /usr/local/lib -maxdepth 2 -iname "*liblzma*" 2>/dev/null | while read -r liblzma_path; do
hexdump -ve '1/1 "%.2x"' "${liblzma_path}"; done; } \
| grep 'f30f1efa554889f54c89ce5389fb81e7000000804883ec28488954241848894c2410' Adaption to macOS of the following source: I've first downgraded to 5.4.6, now the output is "nothing". If it finds the grep'ed string the installed version is vulnerable?! Thank you @porg for the downgrade instructions. Also it should be possible to compare ssh connections (please do not connect to other machines!): Observed requirements for the exploit:
-- if I understand it correctly the list could be extended for macOS by: --
Source: Or am I completely misunderstand this backdoor? |
Beta Was this translation helpful? Give feedback.
-
Thanks for your downgrade instructions! @porg |
Beta Was this translation helpful? Give feedback.
-
@Bo98 I have a question just for my understanding of the brew info command. Does that mean the current formula from where I last updated brew is still referencing to the malicious version upstream, but I have the safe version installed? Because I have read several threads were people were using brew info xz to determine their version, but the installed version might actually be different than the first line of the output. |
Beta Was this translation helpful? Give feedback.
-
Wow! Thanks to Homebrew's swift action, my PC was saved! Truly appreciate the quick and careful response to ensure our systems stay secure. |
Beta Was this translation helpful? Give feedback.
-
There are some reverse engineered steps by Kaspersky: The latest commit by LiaT75 is: tukaani-project/xz@af071ef Commits for changes to xz on homebrew (to re-check yourself that xz wasn't downloaded via https:// xz . tukaani . org: But first off all:
So we should be 99,9% save even if we installed the vulnerable version of 5.6.0 to 5.6.1. Reverting to an earlier version is still advisable. |
Beta Was this translation helpful? Give feedback.
This is intentional as 5.6.x is untrusted: https://www.bleepingcomputer.com/news/security/red-hat-warns-of-backdoor-in-xz-tools-used-by-most-linux-distros/ (see https://www.openwall.com/lists/oss-security/2024/03/29/4 for technical details)
To be clear: we don't believe Homebrew's builds were compromised (the backdoor only applied to deb and rpm builds) but 5.6.x is being treated as no longer trustworthy and as a precaution we are forcing downgrades to 5.4.6.