Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2024-3094 — Ansible role and Python script that detect backdoored liblzma (xz 5.6.0/5.6.1, CVE-2024-3094), back up affected libraries, upgrade packages, and re-scan hosts. | Kitploit
Tools/GitHubGitHub/axisops/cve-2024-3094
Defensive ToolsVulnerability ScannersScripting & AutomationConfiguration AuditingDevSecOpsSupply Chain SecurityIncident Response
GitHubaxisops/cve-2024-3094

CVE-2024-3094

Ansible role and Python script that detect backdoored liblzma (xz 5.6.0/5.6.1, CVE-2024-3094), back up affected libraries, upgrade packages, and re-scan hosts.

View Repository
Oct 30, 2026Not yet reviewed
Share
Website

xz Backdoor CVE-2024-3094 Detection and Mitigation Ansible Role

This Ansible role deploys a Python-based script that finds backdoored liblzma (xz 5.6.0 and 5.6.1, CVE-2024-3094) on a host and replaces it with the distribution's fixed package.

It is designed to be run via Ansible, but you can also execute the script manually if you wish.

Read more about the xz backdoor here:

  • NVD CVE-2024-3094
  • Andres Freund's report on oss-security
  • Debian DSA-5649-1
  • Red Hat: urgent security alert for Fedora Linux 40 and Fedora Rawhide users
  • Ubuntu CVE-2024-3094
  • CISA alert

What it does

The upstream release tarballs for xz 5.6.0 and 5.6.1 contain build-time code that modifies liblzma. sshd does not use liblzma directly, but Debian and several other distributions patch openssh for systemd notification, and libsystemd depends on liblzma. That is the path to ssh server compromise described in the oss-security report of 2024-03-29.

Exposure by distribution, as stated in the advisories above:

DistributionAffectedFixed package
Debiantesting, unstable and experimental, 5.5.1alpha-0.1 up to and including 5.6.1-1. No stable release known to be affected5.6.1+really5.4.5-1
FedoraRawhide (5.6.0, 5.6.1) and Fedora 40 (xz-libs-5.6.0-1.fc40, 5.6.0-2.fc40)xz-5.4.6-3.fc40 (FEDORA-2024-d02c7bb266), epoch bumped
Red Hat Enterprise LinuxNo version affected—
UbuntuNo released version affected; the package reached only noble-proposed and was removed—

Features

  • Reads the installed xz package versions from dpkg-query (liblzma5, xz-utils) and rpm (xz, xz-libs), whichever is present
  • Scans library directories for liblzma.so.5*, resolves symlinks so each real file is counted once, and reads the version from the file name, or from the version string inside the library when the name carries none
  • Reports any 5.6.0 or 5.6.1 (and Debian's 5.5.1alpha)
  • Reads Debian's +really versions correctly: 5.6.1+really5.4.5-1 is the fix, not 5.6.1
  • Reports whether sshd links liblzma, using ldd
  • Dry run by default. Nothing changes without --apply
  • With --apply: backs up every affected library file, mirroring its full path under the backup directory, upgrades the xz packages with apt-get, dnf or yum, and scans again
  • Refuses when no supported package manager is present, and says so
  • Names any affected file the package manager does not own (built from source into /usr/local, or shipped inside an application) after the upgrade, rather than reporting the host clean
  • Writes all actions to a log file and prints a summary to stdout
  • Configurable via a YAML file, resolved relative to the script
  • Packaged as an Ansible role for automated deployment across multiple systems

Requirements

  • Python 3.9+
  • PyYAML, only for a run that reads a YAML config file (the installed apply). The role installs it from the distribution (python3-yaml, py3-yaml or python3-pyyaml), never from PyPI. The detection entry needs only the standard library: its config goes in as JSON on stdin
  • Root, for --apply and --backup-only. Detection runs as any user
  • ldd for the sshd check (part of glibc; the check is skipped without it)

Everything else is the standard library. The package managers are the distribution's own.

Configuration

The script is configured via a YAML file, templated automatically by the role.

Example config.yaml:

scan_paths:
  - /lib
  - /lib64
  - /usr/lib
  - /usr/lib64
  - /usr/local/lib
backup_directory: /opt/backups/xz
log_file: /var/log/xz_backdoor_mitigation.log
check_packages: true
check_sshd: true
sshd_path: /usr/sbin/sshd
  • scan_paths: directories to search for liblzma.so.5*
  • backup_directory: where to keep copies of affected libraries
  • log_file: path to a log file for operation tracking
  • check_packages: query dpkg-query/rpm for package versions
  • check_sshd: report whether sshd links liblzma
  • sshd_path: the sshd binary to check

Role variables (defaults/main.yml) carry the same names with an xz_backdoor_ prefix, plus:

  • xz_backdoor_apply (default true): back up and upgrade when something is found. Set false to report only
  • xz_backdoor_restart_sshd (default false): restart sshd after the upgrade when it links liblzma. Off by default: the restart is the operator's to schedule, and until it happens the running sshd keeps the old library
  • xz_backdoor_script_dest: defaults to /usr/local/lib/xz_backdoor_mitigation/, a directory of its own, so its config.yaml does not overwrite another role's in /usr/local/bin

Usage as an Ansible Role

Add this role to your playbook:

- name: Mitigate xz backdoor CVE-2024-3094
  hosts: all
  become: true
  roles:
    - xz_backdoor_mitigation

The role runs the script to detect, and only when something is found: backs up the affected files, upgrades liblzma5/xz-utils (apt) or xz/xz-libs (dnf, yum) to the latest version in the distribution's repositories, restarts sshd if it links liblzma and xz_backdoor_restart_sshd is true, and runs the script again. The host fails if anything is still affected. Debian's and Fedora's fixed packages both sort above the bad versions, so an ordinary upgrade installs them.

To report only:

ansible-playbook site.yml -e xz_backdoor_apply=false

Usage Directly

If you wish to run the script manually, you can do so:

  1. Copy the script and the shared library beside it to your target machine:

    files/xz_backdoor_mitigator.py
    files/samp_common.py
    
  2. Create your own config.yaml in the same directory.

  3. Run it:

    python3 xz_backdoor_mitigator.py                           # dry run, config.yaml beside the script
    python3 xz_backdoor_mitigator.py --config /path/to/config.yaml
    python3 xz_backdoor_mitigator.py --scan-path /srv/chroot/lib   # repeatable; replaces scan_paths
    sudo python3 xz_backdoor_mitigator.py --apply              # back up, upgrade, re-scan
    sudo python3 xz_backdoor_mitigator.py --backup-only        # back up, change nothing else
    

Validation

  • The script prints scanned=N vulnerable=N backed_up=N upgraded=N failed=N sshd_links_liblzma=N undetermined=N to stdout. Warnings naming each affected package or file go to stderr.
  • Exit codes: 0 nothing affected, 2 something affected remains or a library's version could not be read (undetermined=N), 1 a backup, upgrade or refusal failed, 130 interrupted.
  • Check the configured log file (default: /var/log/xz_backdoor_mitigation.log) for every package and library examined and its version
  • Confirm by hand: dpkg-query -W liblzma5 or rpm -q xz-libs
  • If sshd_links_liblzma=1 on a host that had 5.6.0 or 5.6.1, confirm sshd has restarted since the upgrade
  • Ideally, test in a staging environment before production rollout

Notes

Download Tool

Related Tools

  • wazuh

    Open-source XDR and SIEM platform for threat detection, log analysis, file integrity monitoring, vulnerability assessment, and compliance management across endpoints and cloud workloads.

  • suricata

    Open-source network IDS/IPS/NSM engine for real-time traffic inspection, intrusion detection and prevention, protocol analysis, and rule-based threat hunting.

  • zeek

    Zeek is a powerful network analysis framework that is much different from the typical IDS you may know.

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    ghostlock-app

    yukonga/ghostlock-app

    One-tap Android kernel exploit app for CVE-2026-43499, providing privilege escalation via kernel module loading, with offset extraction and on-device analysis tools.

    745
  • 2

    IMSIcatcher

    28zaaky/imsicatcher

    IMSI Catcher platform that deploys a rogue GSM cell to intercept SMS, inject messages and track mobile devices

    732
  • 3

    Callisto

    jetp1ane/callisto

    Automated binary vulnerability analysis tool that decompiles executables via Ghidra, scans pseudo-C code with Semgrep, and validates findings using GPT-3.5-Turbo to reduce false positives.

    610
  • 4

    opencti

    opencti-platform/opencti

    Open Cyber Threat Intelligence Platform

    546
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    414
  • 6

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    413

Explore all tools

Browse our collection of tools

View all tools →