Skip to content
Memory corruption Write-up Advanced

Copy Fail: Easily gained root access in system.

A logical flaw in the Linux kernel's cryptographic algorithms allowed a non-root user to rewrite the page cache buffer and replace the target binary with shell code, so that executing the binary ran the attacker's code with root privileges. An attacker could therefore gain root access on affected systems.

medium.com

Published on medium.com

Almost 2 days ago a Linux CVE is published named as Copy Fail (CVE-2026–31431). Using this CVE a non root user can gain access to the root.

Somnath Nandi, on medium.com

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 logical flaw in the kernel's cryptographic algorithm implementation that lets a user write into the page cache buffer backing a privileged binary.

Impact

A local non-root user could gain root access, and the author claims this could then be used for remote code execution on any system released after 2017.

What the attacker needed

Local non-root access to the system; unpatched Linux kernel

The fix

The issue was fixed by an upstream kernel patch; users should update their systems to the latest patched kernel.

How it was found

  1. Load the target binary into the kernel page cache.
  2. Run the crypto algorithm to write shell code into the page cache via a socket.
  3. Execute the target binary so the kernel loads it from the page cache.
  4. The shell code runs instead, inheriting the binary's uid 0 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.

The kernel keeps recently used files in memory (the page cache) to speed things up. A bug in some crypto code let a normal user overwrite that in-memory copy of a privileged program with their own code. When the program was run, the kernel executed the attacker's code instead, and because that program runs as the superuser (root), the attacker got full control.

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.

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.