Skip to content
Memory corruption Write-up Advanced

Copy Fail: Universal Linux Local Privilege Escalation Vulnerability

A logic flaw in the Linux kernel's AEAD crypto implementation allows an unprivileged local user to write four controlled bytes into the page cache of any readable file, including setuid binaries. By modifying a privileged binary in memory, an attacker can gain root privileges and, in some container setups, escape to the host.

Amitai Cohen Follow

Published on wiz.io

CVE-2026-31431 (dubbed "Copy Fail") is an easily exploitable vulnerability in the Linux kernel that allows escalation from an unprivileged local user account to root access. The vulnerability was discovered by Xint, and affects nearly all versions of the Linux kernel since 2017.

Amitai Cohen, on wiz.io

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 logic flaw in the Linux kernel's AEAD crypto implementation (algif_aead) where improper handling of scatter-gather lists allows a write beyond intended bounds.

Impact

An unprivileged local user can escalate to root, and in some container scenarios an attacker with access to an unprivileged container sharing a base image with a privileged container on the same node could escape to the host.

What the attacker needed

Local unprivileged user account; vulnerable Linux kernel (2017 to patch); for container escape: shared base image with privileged…

The fix

Update to a kernel version that includes the fix (mainline commit a664bf3d603d), or apply temporary mitigations such as disabling the algif_aead module or blocking AF_ALG socket creation via seccomp policies.

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 Linux kernel has a bug in how it handles certain cryptographic operations. A normal user can abuse this to secretly change a small part of a program that runs with high privileges, without altering the file on disk. Because the change happens in memory, the program can be tricked into running attacker code as the root user.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Amitai Cohen

View all

6 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.