
Defensive detection & mitigation tool for CVE-2026-31431 ("Copy Fail") — Linux kernel algif_aead LPE. No exploit code included.
Automated detection and mitigation tool for the vulnerability
CVE-2026-31431 ("Copy Fail"), a local privilege escalation
(LPE) in the algif_aead module (AF_ALG interface) of the Linux kernel.
⚠️ Scope: this project is purely defensive. It does not contain, generate, or reference exploit code. The goal is to enable security teams and system administrators to (1) identify exposed hosts and (2) apply the recommended mitigation (blocking the
algif_aeadmodule) until the patched kernel is installed.
Detection (--check)
uname -r)algif_aead module is loaded or available for
loadingapt/dpkg,
rpm, zypper) for a reference to the patch/CVE/etc/os-releaseVULNERABLE, MITIGATED (module blocked),
FIXED (kernel already contains the patch), or INDETERMINATEMitigation (--mitigate, requires root)
/etc/modprobe.d/disable-algif-aead-cve-2026-31431.conf with
install algif_aead /bin/false and blacklist algif_aeadrmmod)Report (--report json|text)
# Apenas diagnosticar (não requer root)
sudo ./bin/copyfail-guard --check
# Diagnosticar e aplicar mitigação temporária
sudo ./bin/copyfail-guard --mitigate
# Saída em JSON para integração com outras ferramentas
sudo ./bin/copyfail-guard --check --report json
Requirements: Python 3.8+, Bash, root access only for --mitigate
(the check works without elevated privileges, with limited information).
algif_aead) is temporary. It reduces the
attack surface but does not replace the kernel update.
As soon as the patched kernel package (containing commit
a664bf3d603d or an equivalent backport) is available for your
distribution, it must be applied and the system rebooted.algif_aead (direct use of AF_ALG for
AEAD via userspace) may have functionality impacted by the mitigation.
dm-crypt/LUKS, kTLS, IPsec, SSH and standard OpenSSL/GnuTLS builds
normally do not depend on AF_ALG and are not affected.copyfail-guard/
├── bin/
│ └── copyfail-guard # entrypoint (bash) -> chama o módulo Python
├── copyfail_guard/
│ ├── __init__.py
│ ├── detect.py # lógica de detecção
│ ├── mitigate.py # lógica de mitigação
│ └── report.py # formatação de saída (texto/JSON)
├── tests/
│ └── test_detect.py
├── LICENSE
└── README.md
MIT — see LICENSE.