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
Copy-Fail_Detect_and_mitigate_CVE-2026-31431 — Detects exposure to CVE-2026-31431 (Copy Fail) and optionally mitigates by disabling the vulnerable algif_aead kernel module, providing verdicts and patch status. | Kitploit
Tools/GitHubGitHub/webhosting4u/copy-fail_detect_and_mitigate_cve-2026-31431
Defensive ToolsVulnerability ScannersConfiguration AuditingIncident Response
GitHubwebhosting4u/copy-fail_detect_and_mitigate_cve-2026-31431

Copy-Fail_Detect_and_mitigate_CVE-2026-31431

Detects exposure to CVE-2026-31431 (Copy Fail) and optionally mitigates by disabling the vulnerable algif_aead kernel module, providing verdicts and patch status.

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 →
284 months agoNot yet reviewed
Share

Copy Fail - CVE-2026-31431 Detector and Mitigator

Bash Platform CVE CVSS Status

Detect exposure to CVE-2026-31431 (Copy Fail) and optionally apply a host-level mitigation by disabling the algif_aead kernel module on vulnerable systems.

What this repo provides

  • copyfail-check.sh — checks kernel patch status, runtime module exposure, and mitigation state.
  • Optional automatic mitigation via --mitigate.
  • Human-readable verdict output: NOT AFFECTED, PATCHED, NOT EXPLOITABLE, MITIGATED, MITIGATED (REBOOT PENDING), or AFFECTED.

Vulnerability summary

A 2017 in-place AEAD optimization (commit 72548b093ee3, kernel 4.14) allows an unprivileged local attacker to obtain a controlled page-cache write primitive against any readable file, enabling privilege escalation to root. In container environments the same primitive may facilitate container escape.

Kernels before 4.14 are NOT affected. This includes Ubuntu's 3.13 kernel (Trusty 14.04 GA) and 4.4 kernel (Xenial 16.04 GA, Trusty HWE) — those predates the vulnerable commit.

Commit references

RoleCommit
Vulnerability introduced72548b093ee3 (kernel 4.14, 2017)
Fix — mainline / kernel 7.0

Distros backport patches with their own commit identifiers. The script searches for the CVE ID in package changelogs, which is more reliable than the upstream hashes for backported kernels.

Affected Ubuntu releases

The Ubuntu Security Team distributes a kmod package update that writes install algif_aead /bin/false to /etc/modprobe.d/disable-algif_aead.conf. This script creates the same file with the same content and is fully compatible with that approach. Applying the official package update (sudo apt install --only-upgrade kmod) is the recommended path on Ubuntu; this script provides equivalent coverage for non-Ubuntu systems or pre-update triage.

Quick start

Local

root@kitploit:~
chmod +x copyfail-check.sh
sudo ./copyfail-check.sh                # detection only
sudo ./copyfail-check.sh --mitigate     # detection + apply mitigation if affected

Remote (run directly from GitHub, no download)

Stream the script straight from main and execute it. The bash -s -- form forwards arguments after -- into the script itself, so --mitigate reaches the script and not bash.

root@kitploit:~
# Detection only
curl -fsSL https://raw.githubusercontent.com/Webhosting4U/Copy-Fail_Detect_and_mitigate_CVE-2026-31431/main/copyfail-check.sh | sudo bash

# Detection + mitigation
curl -fsSL https://raw.githubusercontent.com/Webhosting4U/Copy-Fail_Detect_and_mitigate_CVE-2026-31431/main/copyfail-check.sh | sudo bash -s -- --mitigate

wget equivalents:

root@kitploit:~
wget -qO- https://raw.githubusercontent.com/Webhosting4U/Copy-Fail_Detect_and_mitigate_CVE-2026-31431/main/copyfail-check.sh | sudo bash
wget -qO- https://raw.githubusercontent.com/Webhosting4U/Copy-Fail_Detect_and_mitigate_CVE-2026-31431/main/copyfail-check.sh | sudo bash -s -- --mitigate

Security note. Piping a remote script straight into a privileged shell trusts whatever the URL serves at the moment of execution. For one-off triage that is acceptable; for repeated or production use, pin to a specific commit and inspect the script first:

root@kitploit:~
curl -fsSL https://raw.githubusercontent.com/Webhosting4U/Copy-Fail_Detect_and_mitigate_CVE-2026-31431/<commit-sha>/copyfail-check.sh -o copyfail-check.sh
less copyfail-check.sh
sudo bash copyfail-check.sh --mitigate

What gets checked

  1. Running as root
  2. Kernel version pre-check — kernels before 4.14 exit immediately as NOT AFFECTED
  3. Kernel patch evidence, in this order — any positive signal is sufficient:
    • Debian/Ubuntu kernel-package changelog (searches for all three fix commit hashes and the CVE ID)
    • RHEL/Fedora kernel-package changelog (same patterns)
    • Loaded kernel livepatches under /sys/kernel/livepatch/, plus kpatch list and canonical-livepatch status
    • Distro CVE tooling: ubuntu-security-status --cves, dnf updateinfo list cves, zypper patch-check
  4. algif_aead module availability (modinfo) and load state (lsmod)
  5. Existing modprobe-based block rules under /etc/modprobe.d/ — accepts equivalent neutralizers (install … /bin/false|/bin/true|/sbin/nologin) and ; identifies whether the block came from the Ubuntu kmod package

Verdict meanings

What mitigation does

When --mitigate is used on an affected system, the script:

  • Creates /etc/modprobe.d/disable-algif_aead.conf containing install algif_aead /bin/false
  • Attempts to unload algif_aead if currently loaded
  • Leaves a persistent boot-time block in place

The filename /etc/modprobe.d/disable-algif_aead.conf matches the file written by the official Ubuntu kmod package update, so both approaches are interchangeable and compatible.

Important notes

  • Mitigation is a temporary risk reduction, not a replacement for kernel patching.
  • Disabling algif_aead is safe for common crypto paths: dm-crypt, LUKS, kTLS, IPsec, default OpenSSL/GnuTLS usage, SSH, and kernel keyring crypto are unaffected.
  • Applications that explicitly load the OpenSSL afalg engine will lose hardware acceleration; they should fall back to software crypto, but a reboot may be required to trigger the fallback.
  • Container workloads: the vulnerability may enable container escape even without a published PoC. Applying the mitigation or kernel patch is recommended regardless of workload type.

Disclosure timeline

DateEvent
2026-03-23Reported to Linux kernel security team
2026-04-01Fix committed to mainline
2026-04-29Public disclosure

Requirements

  • Linux host
  • Root privileges (sudo or root shell)
  • Core tools (always required): uname, modinfo, lsmod, awk, grep
  • Optional tools (used when present, in order of authority):
    • dpkg — Debian/Ubuntu changelog scan and kmod version check
    • lsb_release — Ubuntu release detection for kmod hint
    • rpm — RHEL/Fedora changelog scan
    • kpatch / canonical-livepatch and /sys/kernel/livepatch/ — live-patch detection
    • ubuntu-security-status, dnf updateinfo, — distro CVE tooling

Repository structure

root@kitploit:~
.
├── copyfail-check.sh
└── README.md

References

  • copy.fail — official vulnerability page
  • Copy Fail across Linux distributions — distribution coverage analysis
  • oss-security disclosure — full technical disclosure
  • Ubuntu Security Advisory — Ubuntu-specific guidance and fixed package versions
  • CVE Record — official CVE entry
Download Tool
PropertyValue
CVE IDCVE-2026-31431
SeverityHIGH (CVSS 3.1: 7.8)
Componentalgif_aead — kernel AF_ALG AEAD crypto interface
Attack typeLocal privilege escalation; container escape (no public PoC yet)
Affected kernels4.14 and later (see below)
Disclosed2026-04-29
a664bf3d603d
Fix — stable 6.18.xfafe0fa2995a
Fix — stable 6.19.xce42ee423e58
Releaselinux kernelkmod mitigation (fixed version)
Trusty 14.044.15 kernels only; 3.13 and 4.4 NOT affected15-0ubuntu7+esm1
Xenial 16.044.15 kernels only; 4.4 NOT affected22-1ubuntu5.2+esm1
Bionic 18.04Affected24-1ubuntu3.5+esm1
Focal 20.04Affected27-1ubuntu2.1+esm1
Jammy 22.04Affected29-1ubuntu1.1
Noble 24.04Affected31+20240202-2ubuntu7.2
Questing 25.10Affected34.2-2ubuntu1.1
Resolute 26.04Not affectedNo update needed
blacklist
  • Ubuntu kmod package hint — if the module is unblocked and the system is Ubuntu, reports whether the mitigation package update is available for the detected release
  • Active AF_ALG usage via the module's reference count in /proc/modules (column 3); also flags an OpenSSL afalg engine reference in /etc/ssl or /etc/pki/tls
  • Final risk verdict
  • VerdictMeaning
    NOT AFFECTEDKernel predates 4.14, or is patched and module unavailable
    PATCHEDKernel changelog/tooling confirms the fix is present
    NOT EXPLOITABLEModule not available on this system
    MITIGATEDModule blocked via modprobe.d; kernel still unpatched — update when possible
    MITIGATED (REBOOT PENDING)Block written but module still loaded; unload with rmmod or reboot
    AFFECTEDKernel is in vulnerable range and algif_aead is available
    zypper patch-check