Copy Fail: How 732 Bytes of Python Got Root on Almost Every Linux
A logic flaw in the Linux kernel's AF_ALG crypto interface allows an unprivileged user to perform a deterministic 4-byte write into the page cache of any readable file, enabling injection of shellcode into a setuid-root binary such as /usr/bin/su and subsequent privilege escalation to root.
Published on medium.com
On 29 April 2026, researchers at Theori and Xint dropped a Linux LPE that had been quietly exploitable since 2017. It works on Ubuntu, RHEL, Amazon Linux, SUSE — pretty much anything with a kernel built in the last nine years.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a 2017 in-place optimisation in algif_aead caused the destination buffer to include chained page-cache pages, and the authencesn algorithm's scratch write then landed in those pages.
Impact
An unprivileged local user could gain root on almost every Linux distribution, and in shared-kernel container environments the flaw could be used to corrupt binaries executed by other containers or the host, acting as a container-escape primitive.
What the attacker needed
Local unprivileged access; target file readable by the user; kernel with AF_ALG and authencesn
The fix
The fix reverts algif_aead to out-of-place operation, removing the 2017 optimisation; interim mitigations include blacklisting the algif_aead module or blocking AF_ALG socket creation via seccomp.
How it was found
- Open an AF_ALG socket and bind to the authencesn algorithm with a dummy key.
- For each 4-byte chunk of shellcode, build a sendmsg with the desired bytes in the AAD.
- Splice the target region of /usr/bin/su into the socket with chosen assoclen and cryptlen.
- Call recv to trigger the decrypt and write the four bytes into the cached su binary.
- Repeat until the shellcode is fully written.
- Execute /usr/bin/su to load the corrupted binary from page cache and gain root.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The page cache is a copy of file contents kept in memory for speed. A bug in the kernel's encryption interface let a normal user change a few bytes in that in-memory copy without altering the file on disk. By changing the right bytes in a program that runs with root privileges, the user could make it run their own code as root.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.