
Python exploit for CVE-2026-31431, a Linux kernel local privilege escalation via AF_ALG and splice() to write to page cache, gaining root on arm64 and x86.
| Item | Content |
|---|---|
| CVE ID | CVE-2026-31431 |
| Vulnerability Name | Copy Fail |
| Vulnerability Type | Linux Kernel Local Privilege Escalation (LPE) |
| CVSS 3.1 Score | 7.8 (HIGH) |
| CWE | CWE-669: Incorrect Resource Transfer Between Spheres |
| Affected Scope | All Linux kernels built between 2017 and April 2026 |
| CISA KEV | Listed, remediation deadline 2026-05-15 |
| Disclosure Date | 2026-04-29 |
In 2017, the kernel introduced an in-place encryption optimization in the algif_aead crypto module. This optimization caused page-cache pages to be incorrectly placed into a writable destination scatterlist. By combining the AF_ALG socket with the splice() system call, an attacker can write data to the page cache of arbitrary files, including root-owned read-only files.
Attack Chain: AF_ALG socket → splice() → page-cache write primitive → tamper with setuid binary page cache → execute the file to gain root privileges
Attack Characteristics:
| Distribution | Affected Kernel Version |
|---|---|
| Ubuntu 24.04 LTS | 6.17.0-1007-aws |
| Amazon Linux 2023 | 6.18.8-9.213.amzn2023 |
| RHEL 10.1 | 6.12.0-124.45.1.el10_1 |
| SUSE 16 | 6.12.0-160000.9-default |
Distributions such as Debian, Arch, Fedora, Rocky, Alma, and Oracle with the same kernel range are also affected.
All kernel versions below the following fixed versions are affected:
uname -r
Compare the output with the fixed versions in the table above. If the version is lower than the fixed version, the system is affected.
# Check for current AF_ALG connections
lsof | grep AF_ALG
# Check AF_ALG socket status
ss -xa | grep alg
lsmod | grep algif_aead
If there is output, the module is loaded and the system is at risk of exploitation.
# Clone the PoC repository
git clone https://github.com/cx330zer0/CVE-2026-31431-Copy-Fail-add-arm64.git
cd CVE-2026-31431-Copy-Fail-add-arm64
# Run the PoC (requires non-privileged user identity)
python3 copy-fail-dual-arch.py
If the PoC successfully obtains a root shell, the system is vulnerable to this flaw.
| Stable Branch | Minimum Fixed Version |
|---|
| 5.10.x | ≥ 5.10.254 |
| 5.15.x | ≥ 5.15.204 |
| 6.1.x | ≥ 6.1.170 |
| 6.6.x | ≥ 6.6.137 |
| 6.12.x | ≥ 6.12.85 |
| 6.18.x | ≥ 6.18.22 |
| 6.19.x | ≥ 6.19.12 |
| 7.0.x | ≥ 7.0-rc7 |