Copy Fail (CVE-2026–31431): How a 2017 Performance Optimization
A logic flaw in the Linux kernel's crypto subsystem allowed any local user to write 4 controlled bytes into the page cache of any readable file, including setuid binaries, enabling deterministic privilege escalation to root. The vulnerability existed since a 2017 performance optimisation and affected most Linux distributions.
Published on medium.com
A logic bug in the Linux kernel’s crypto subsystem gave any local user a deterministic, traceless path to root. It was there since 2017.
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 the 2017 in-place optimisation (req->src = req->dst) removed the separation between source and destination buffers, so the authencesn algorithm's 4-byte scratch write landed in the page cache of the input file instead of a separate output buffer.
Impact
Any unprivileged local user could gain root access deterministically on affected systems, and the attack leaves no disk trace and can escape containers because the page cache is shared.
What the attacker needed
Local user access; Python 3.10+; vulnerable kernel (2017–patch)
The fix
The fix reverts the 2017 optimisation, restoring separation between source and destination scatterlists in the kernel's crypto interface; patches are available.
How it was found
- Open an AF_ALG socket bound to the authencesn algorithm.
- Deliver a target setuid binary to the socket using splice().
- Trigger the encryption operation, causing authencesn to write 4 scratch bytes into the file's page cache.
- Execute the modified setuid binary to gain root privileges.
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.
This is a bug in the core of Linux, the part that manages memory and security. A small mistake in how the system handles encrypted data let a normal user quietly change a program that runs with full administrator rights, without leaving any trace on the hard drive. Because the change only exists in memory, the attacker can become the administrator every time that program is run.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.