Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2024-3094 — Educational lab replicating the XZ Utils backdoor (CVE-2024-3094) with a custom Ed448 key pair. Includes a patched liblzma, systemd service, and exploit client for authorized security research. | Kitploit
Tools/GitHubGitHub/h3raklez/cve-2024-3094
Vulnerability AnalysisExploitationMalware AnalysisCryptographyPenetration TestingSupply Chain SecurityLearning & EducationLabs & Practice
GitHubh3raklez/cve-2024-3094

CVE-2024-3094

Educational lab replicating the XZ Utils backdoor (CVE-2024-3094) with a custom Ed448 key pair. Includes a patched liblzma, systemd service, and exploit client for authorized security research.

View Repository
45 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2024-3094 — XZ Utils Backdoor

For educational and authorized security research purposes only.

Vulnerability Description

CVE-2024-3094 is a backdoor introduced in versions 5.6.0 and 5.6.1 of XZ Utils (liblzma), discovered on March 29, 2024 by security researcher Andres Freund. It was assigned a CVSS score of 10.0 (Critical).

This is a supply chain attack carried out over more than two years by a threat actor known as "Jia Tan" (JiaT75), who built trust within the project until gaining co-maintainer status and introduced the backdoor directly into the distribution tarballs.

Technical Mechanism

The backdoor operates as follows:

  1. The malicious liblzma.so hooks the RSA_public_decrypt() function in OpenSSH via glibc's IFUNC mechanism, intercepting the SSH authentication process.
  2. When a client connects, the backdoor evaluates a specific field in the presented SSH certificate.
  3. If that field contains a payload encrypted with ChaCha20 and signed with a specific Ed448 private key, the backdoor executes the embedded command via system() with sshd privileges (root).
  • If the signature is invalid, sshd continues its normal flow with no anomaly.
  • Exploitation Requirements

    • System with glibc (IFUNC support)
    • XZ Utils 5.6.0 or 5.6.1 installed
    • sshd launched from systemd (critical requirement — IFUNC hooking does not activate if sshd is launched manually from the command line)
    • x86-64 system

    Originally Affected Distributions

    • Fedora Linux 40 beta / Rawhide
    • Debian unstable, testing, experimental
    • Kali Linux
    • Arch Linux (images between 2024-02-24 and 2024-03-28)

    Lab Environment

    This lab replicates the backdoor mechanism using custom Ed448 keys instead of the original actor's keys (which were never made public).

    Why We Use chroot

    In real affected systems there was no chroot. The backdoor operated directly on the system's sshd, which loaded the malicious liblzma.so as any other shared library — completely transparent to the system and its administrators.

    In this lab we use chroot solely for a practical reason: we need to run an sshd with a specific version of liblzma.so without replacing the host system's libraries. This is a design decision for the research environment, not a reflection of how the backdoor operated in production.

    Components

    ComponentDescription
    env_fs/Minimal Ubuntu 22.04 filesystem used as chroot
    env_fs/usr/lib/x86_64-linux-gnu/liblzma.so.5liblzma 5.6.1 patched with custom Ed448 key
    /etc/systemd/system/xzback.servicesystemd service launching vulnerable sshd on port 2024
    /xzbot/xzbotExploit client compiled from source

    Target Stack

    • Ubuntu 22.04.1 LTS AMD64
    • glibc 2.35
    • OpenSSH 8.9p1
    • systemd 249
    • liblzma 5.6.1 (patched)

    Modifications Made for This Target

    The original backdoor requires very specific conditions that do not exist automatically in a lab environment. The following modifications were necessary:

    1. liblzma.so Replacement

    The liblzma.so.5 included in MagpieRYL's original repo uses an unknown Ed448 key that is inconsistent with the included xzbot binary. The original and authentic liblzma.so.5.6.1 was downloaded from Debian snapshot (sha256 verified) and patched using patch.py from amlweems/xzbot with seed=0:

    root@kitploit:~
    original sha256:  605861f833fc181c7cdcabd5577ddb8989bea332648a8f498b4eef89b8f85ad4
    patched sha256:   ea7206ab4b0c3479ff1b478c8803adc9e7aeba243254a9f601b626ef8aa80e3d
    patched offset:   0x24470
    

    The original actor's Ed448 public key was replaced with:

    root@kitploit:~
    5b 3a fe 03 87 8a 49 b2 82 32 d4 f1 a4 42 ae bd
    e1 09 f8 07 ac ef 7d fd 9a 7f 65 b9 62 fe 52 d6
    54 73 12 ca ce cf f0 43 37 50 8f 9d 25 29 a8 f1
    66 91 69 b2 1c 32 c4 80 00
    

    2. Type=simple in the systemd Service

    The original service uses Type=notify, which requires sshd to send a startup notification to systemd. The sshd inside the chroot does not send it, causing timeouts. Changed to Type=simple.

    3. Ephemeral chroot Directories

    sshd requires /run/sshd for privilege separation. This directory does not exist in the chroot and is wiped on every reboot because run/ is a tmpfs. Solved with an ExecStartPre that regenerates it automatically before each service start.


    Usage

    Exploit from the Same Machine

    root@kitploit:~
    ./xzbot -addr 127.0.0.1:2024 -cmd 'echo pwned > /tmp/result'
    cat /home/user/CVE-2024-3094-backdoor-env-container/env_fs/tmp/result
    

    Exploit from Another Machine

    root@kitploit:~
    ./xzbot -addr <TARGET_IP>:2024 -cmd 'echo pwned > /tmp/result'
    

    Location of Files Generated by the Exploit

    The command executes inside the chroot, so any file created under /tmp/ within the backdoor context is stored at:

    root@kitploit:~
    /home/user/CVE-2024-3094-backdoor-env-container/env_fs/tmp/
    

    That is, if the command is echo pwned > /tmp/result, the file will be found at:

    root@kitploit:~
    /home/user/CVE-2024-3094-backdoor-env-container/env_fs/tmp/result
    

    To locate any file generated by the exploit:

    root@kitploit:~
    find /home/user/CVE-2024-3094-backdoor-env-container/env_fs/tmp/ -type f
    

    Note on handshake failed: EOF

    The message ssh: handshake failed: EOF is the expected and correct behavior. The backdoor executes the command and closes the connection without establishing an SSH session. It does not indicate failure.


    Important

    This lab uses a custom cryptographic key pair (seed=0). The patched liblzma.so only accepts payloads signed with the corresponding private key, which is the one used by the xzbot compiled in this environment. Any other client will receive EOF without execution.


    References

    • Original Openwall disclosure
    • amlweems/xzbot
    • MagpieRYL/CVE-2024-3094-backdoor-env-container
    • Datadog Security Labs writeup
    • Wikipedia — XZ Utils backdoor

    Disclaimer

    This tool is provided for educational purposes and authorized security testing only. Unauthorized use against systems you do not own or have explicit written permission to test is illegal. The author is not responsible for any misuse.

    Download Tool