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
ansible-role-cve-2026-31431 — Ansible role that applies and verifies the modprobe.d mitigation for CVE-2026-31431 by disabling the algif_aead kernel module, with safety checks for Debian-family systems. | Kitploit
Tools/GitHubGitHub/joltcan/ansible-role-cve-2026-31431
Cloud Infrastructure SecurityVulnerability AnalysisConfiguration AuditingDevSecOps
GitHubjoltcan/ansible-role-cve-2026-31431

ansible-role-cve-2026-31431

Ansible role that applies and verifies the modprobe.d mitigation for CVE-2026-31431 by disabling the algif_aead kernel module, with safety checks for Debian-family systems.

View Repository

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
3 months agoNot yet reviewed
Share

ansible-role-cve-2026-31431

Ansible role to apply (and later remove) the modprobe.d mitigation for CVE-2026-31431 ("Copy Fail") in the Linux kernel's AF_ALG / algif_aead subsystem.

Tested on Debian. Pull requests for other distributions, edge cases, or improvements are very welcome.

What it does

The role drops a config snippet into /etc/modprobe.d/ that prevents the algif_aead kernel module from being loaded:

root@kitploit:~
install algif_aead /bin/false

It then verifies the mitigation is actually effective by:

  1. Asserting the host is Debian-family (the only place this technique reliably works — see warning below).
  2. Reading /boot/config-$(uname -r) and refusing to run if AEAD is built into the kernel (CONFIG_CRYPTO_USER_API_AEAD=y) — modprobe.d cannot block built-in code.
  3. Warning if any process currently holds AF_ALG sockets open (those keep the module pinned in memory until they release).
  • Confirming algif_aead is not currently in lsmod.
  • Running a small Python script that opens an AF_ALG socket and tries to bind() to aead/gcm(aes). After the mitigation, the bind must fail with FileNotFoundError.
  • No reboot is required.

    To revert (e.g. once a patched kernel is in place), set cve_2026_31431_state=absent.

    Warning: the modprobe.d workaround does not work everywhere

    The mitigation circulating on oss-security — dropping install algif_aead /bin/false into /etc/modprobe.d/ and rmmod'ing the module — does not work on CloudLinux, AlmaLinux, RHEL, or any other RHEL-family distribution, and does not work on custom kernels built with AEAD compiled in.

    On those systems algif_aead is built into the kernel (CONFIG_CRYPTO_USER_API_AEAD=y), so:

    • modprobe.d rules cannot block loading (there is nothing to load — the code is already in the kernel image).
    • rmmod algif_aead cannot remove built-in code.

    The commands appear to succeed but leave the system unchanged, giving a false sense of protection. You can confirm whether your kernel is affected:

    root@kitploit:~
    zgrep '^CONFIG_CRYPTO_USER_API_AEAD=' /boot/config-$(uname -r)
    
    • =m → module, this role can mitigate.
    • =y → built-in, you need a kernel update + reboot or a livepatch subscription. This role will detect this and refuse to run.

    Variables

    NameDefaultNotes
    cve_2026_31431_statepresentSet to absent to remove mitigation
    cve_2026_31431_conf/etc/modprobe.d/disable-algif_aead.confPath to the blacklist file

    Usage

    From Ansible Galaxy (recommended)

    root@kitploit:~
    ansible-galaxy install joltcan.cve_2026_31431
    ansible-playbook -i <your-inventory> ~/.ansible/roles/joltcan.cve_2026_31431/playbook.yml
    

    Cleanup once the patched kernel is running:

    root@kitploit:~
    ansible-playbook -i <your-inventory> ~/.ansible/roles/joltcan.cve_2026_31431/playbook.yml -e cve_2026_31431_state=absent
    

    From a playbook of your own

    root@kitploit:~
    - hosts: all
      become: true
      roles:
        - role: joltcan.cve_2026_31431
    

    Contributing

    Issues and pull requests are welcome — particularly:

    • Tested support for non-Debian distributions where algif_aead is loadable (Arch, Gentoo, Alpine, etc.).
    • Logic for safely unloading an already-loaded algif_aead when no AF_ALG users are active.
    • Molecule scenarios for CI.

    License

    MIT — see LICENSE.

    Download Tool