
Defensive research repository for CVE-2026-31431, a Linux kernel local privilege escalation via page cache corruption through AF_ALG, splice(), and authencesn. Includes technical analysis, detection strategies, and mitigation measures.
Copy Fail (CVE-2026-31431) is a Local Privilege Escalation (LPE) vulnerability affecting the Linux kernel via controlled corruption of the page cache through the AF_ALG, splice() and authencesn mechanisms.
This repository aims to:
⚠️ This project is strictly educational, defensive, and intended for security research.
All demonstrations presented in this repository were carried out in isolated, controlled laboratory environments.
No use on third-party systems without explicit permission is allowed.
| Characteristic | Detail |
|---|---|
| No race condition | Deterministic exploitation |
| No disk modification | Difficult detection |
Comparable to:
User Space
↓
AF_ALG Socket
↓
splice()
↓
Page Cache Reference
↓
authencesn In-Place Write
↓
Controlled 4-Byte Overwrite
↓
execve()
↓
Privilege Escalation
2011 → authencesn added to kernel
2015 → AF_ALG gets AEAD + splice() support
2017 → In-place optimization in algif_aead.c
2026 → Discovery and official patch
AF_ALGSocket interface exposing cryptographic primitives of the Linux kernel to userspace.
splice()Mechanism allowing page transfer without copy between file descriptors.
authencesnAEAD IPsec ESN template using the destination buffer as temporary workspace.
The optimization introduced in algif_aead.c allowed direct chaining of page cache pages into the destination scatterlist via sg_chain().
Input SGL: AAD || Ciphertext || Tag (page cache)
↑
Output SGL: AAD || Ciphertext ------+
authencesn then writes directly into the page cache pages of the target file.
| Primitive | Control |
|---|---|
| Target file | Any readable file |
| Offset |
⚠️ Reserved for isolated test environments.
uname -r
lsmod | grep algif_aead
python3 --version
git clone https://github.com/theori-io/copy-fail-CVE-2026-31431.git
cd copy-fail-CVE-2026-31431
python3 copy_fail_exp.py
auditctl -a always,exit -F arch=b64 -S socket -F a0=38 -k af_alg_socket
auditctl -a always,exit -F arch=b64 -S splice -k splice_monitor
ps aux | awk '$1 == "root"'
ss -tlnp
algif_aeadecho "install algif_aead /bin/false" | sudo tee /etc/modprobe.d/disable-algif-aead.conf
sudo rmmod algif_aead
{
"defaultAction": "SCMP_ACT_ALLOW",
"syscalls": [
{
"names": ["socket"],
"action": "SCMP_ACT_ERRNO",
"args": [
{ "index": 0, "value": 38, "op": "SCMP_CMP_EQ" }
]
}
]
}
The patch a664bf3d603d removes the vulnerable in-place operation in algif_aead.c.
sudo apt update && sudo apt upgrade
sudo reboot
| Date | Event |
|---|---|
| 2017 | Vulnerability introduced |
| 2026-03-23 | Reported to kernel security team |
| 2026-04-01 | Patch integrated |
| 2026-04-29 | Public disclosure |
linux kernel security, CVE-2026-31431, copy fail, page cache, AF_ALG, authencesn, linux LPE, kernel exploit, linux hardening, security research, dirty pipe, kernel mitigation
This repository is intended exclusively for:
Any unauthorized use is illegal.
🛡️ Awareness • Mitigation • Defensive Research
🔁 Share the project with the cybersecurity community
⭐ Support Linux security research
| Element | Value |
|---|
| Type | Local Privilege Escalation |
| Impact | Local root |
| Component | Linux Kernel |
| Subsystem | AF_ALG / authencesn |
| Primitive | Controlled write into page cache |
| Condition | Non-privileged user |
| Stealth | Disk file intact |
| Severity | Critical |
| Minimalist exploit | Python standard only |
| Container impact | Kubernetes / VPS / shared hosting |
| Wide window | Vulnerable kernels since 2017 |
| Controlled via splice |
| Written value | seqno_lo field |
| Persistence | Memory only |
| Disk detection | Impossible |
| Distribution | Kernel | Status |
|---|
| Ubuntu 24.04 LTS | 6.17.0-1007-aws | ✅ Vulnerable |
| Amazon Linux 2023 | 6.18.8-9.213 | ✅ Vulnerable |
| RHEL 10.1 | 6.12.0 | ✅ Vulnerable |
| SUSE 16 | 6.12.0 | ✅ Vulnerable |
| Resource | Description |
|---|
| Dirty Pipe | CVE-2022-0847 |
| Linux Kernel Docs | Official documentation |
| Openwall Security | Security mailing list |
| LWN.net | Linux kernel analysis |
| AF_ALG Documentation | Crypto API |
| XFRM / IPsec | Affected subsystem |