
Local privilege escalation exploit for Linux kernel CVE-2026-31431, abusing AF_ALG and splice to patch /usr/bin/su and gain root.
Local privilege escalation exploit targeting a Linux kernel copy-on-write vulnerability via AF_ALG sockets and splice operations.
This exploit abuses a kernel-level memory corruption condition in the Linux crypto subsystem (AF_ALG) combined with zero-copy mechanisms (splice) to modify a privileged binary in memory.
By patching /usr/bin/su at runtime, it allows escalation to root without requiring valid credentials.
Compile statically to be able to use in any Linux environment with no need of Python or aditional libraries.
gcc -o exploit exploit.c -lz -static
./exploit
/usr/bin/suAF_ALG AEAD socketsplice() syscalls for zero-copy memory manipulationsu to obtain root shellCONFIG_CRYPTO_USER_API_AEAD enabledPatch to a fixed kernel version once available
Disable unprivileged user namespaces if not required:
sysctl -w kernel.unprivileged_userns_clone=0
Monitor suspicious use of:
AF_ALG socketssplice() syscallsApply kernel hardening (LSM, seccomp, etc.)
For educational and authorized security research purposes only.
Unauthorized use of this exploit may violate applicable laws.
I do not own the original code nor was the one to found the CVE.
AF_ALG / crypto subsystem)