
Proof-of-concept exploit for CVE-2026-31431, a Linux kernel page-cache corruption vulnerability enabling local privilege escalation via algif_aead. Includes exploit.py and mitigation guidance.
A professional proof-of-concept for the CVE-2026-31431 vulnerability, a critical flaw in the Linux kernel's algif_aead / authencesn page-cache handling.
The CVE-2026-31431 vulnerability, colloquially known as "Copy Fail", involves a page-cache scratch-write bug disclosed on April 29, 2026. It allows an unprivileged local user to corrupt the page-cache view of system-critical files like /etc/passwd or /usr/bin/su without modifying the on-disk file, enabling Local Privilege Escalation (LPE). [1]
The algif_aead component performs AEAD (Authenticated Encryption with Associated Data) operations in-place. When source data is fed via splice() from a regular file, the destination scatterlist references the file's page-cache pages. The authencesn(hmac(sha256), cbc(aes)) algorithm performs a 4-byte "scratch" write of the AAD's seqno_lo field into the destination, directly corrupting the page-cache copy. [1]
| Distribution | Status |
|---|---|
| Ubuntu 24.04 LTS | Confirmed Vulnerable |
Note: Any kernel carrying commit
72548b093ee3(dating back to 2017) without the upstream revert is potentially affected.
| File | Description |
|---|---|
exploit.py | A compact implementation of the LPE primitive targeting system binaries. |
To gain a root shell using the provided exploit script:
python3 exploit.py
The script automates the page-cache corruption of /usr/bin/su or /etc/passwd to elevate privileges. Users are advised to thoroughly review the code before execution, as it interacts with sensitive system components.
The core primitive leverages the following sequence:
sendmsg with 8-byte AAD and specific AEAD controls.splice() the target file descriptor into the operation socket.recv(), which executes the scratch write before returning an error.Until a patched kernel is deployed, the algif_aead module should be disabled:
sudo tee /etc/modprobe.d/disable-algif-aead.conf <<<'install algif_aead /bin/false'
sudo rmmod algif_aead 2>/dev/null
WARNING: This tool is for educational and authorized security assessment purposes only. Unauthorized use against systems you do not own or have explicit permission to test is illegal and unethical. The authors assume no liability for misuse.
[1] Xint Blog: Copy Fail - Linux Distributions Disclosure
© 2026 BEN
| Amazon Linux 2023 | Confirmed Vulnerable |
| RHEL 14.3 | Confirmed Vulnerable |
| SUSE 16 | Confirmed Vulnerable |