New Linux bug enables Root via page‑cache corruption


Copy Fail: New Linux bug enables Root via page‑cache corruption

Pierluigi Paganini
April 30, 2026

Linux flaw CVE‑2026‑31431, ‘Copy Fail,’ lets any local user write four bytes into page cache files, enabling easy escalation to root on major distros.

Xint Code researchers warn of a serious Linux flaw, tracked as CVE-2026-31431 (CVSS score of 7.8), dubbed Copy Fail. It lets any local, unprivileged user write four controlled bytes into the page cache of any readable file, enabling escalation to root on major distributions.

The bug combines AF_ALG and splice() to write 4 bytes into the page cache of any readable file. A 732-byte script can modify a setuid binary in memory, without changing the file on disk, making detection difficult. The issue affects major distributions like Ubuntu, RHEL, SUSE, and Amazon Linux, and can even cross container boundaries due to shared page cache.

Copy Fail (CVE-2026-31431) is a logic bug in the Linux kernel’s authencesn cryptographic template. It lets an unprivileged local user trigger a deterministic, controlled 4-byte write into the page cache of any readable file on the system.” reads the report published by Xint Code. “A single 732-byte Python script can edit a setuid binary and obtain root on essentially all Linux distributions shipped since 2017.

Copy Fail exploits a kernel logic flaw where corrupted page‑cache data is never marked dirty, leaving disk files unchanged while the in‑memory version is silently altered. Because the page cache is what processes read, an unprivileged user can corrupt a setuid binary’s cached page and gain root. The shared cache also lets the attack cross container boundaries. The bug, surfaced through AI‑assisted analysis of crypto‑subsystem behavior, is portable, tiny, race‑free, and stealthy, unlike Dirty Cow or Dirty Pipe. It works across major distros and architectures and forms the basis for both local privilege escalation and Kubernetes container escapes.

The bug starts in AF_ALG, which lets any user access the kernel crypto subsystem without privileges. Attackers use splice() to map file page cache pages directly into a crypto scatterlist, so operations act on real file-backed memory. During AEAD decryption, the kernel sets the operation in-place, mixing user buffers with page cache pages in one writable structure.

The authencesn algorithm breaks expectations: it uses the output buffer as scratch space and writes 4 bytes past the allowed boundary. In this setup, that write lands directly in the page cache of a chosen file. Attackers control the file, offset, and value, enabling precise memory corruption and privilege escalation.

This flaw emerged from combined changes over years, authencesn design, AF_ALG support, and a 2017 in-place optimization, creating a long-hidden but critical vulnerability.

The exploit targets /usr/bin/su, a common setuid-root binary on Linux systems.

  • First, the attacker opens an AF_ALG socket and binds it to the vulnerable authencesn AEAD mode. No privileges are required. The attacker sets a cryptographic key and creates a request socket.
  • Next, the attacker prepares each 4-byte write. The AAD carries the exact 4-byte value to inject, while splice() maps page cache pages from the target file into the crypto operation. Carefully chosen parameters force the kernel to treat a specific offset inside /usr/bin/su as writable memory.
  • Then the attacker triggers recv(), which runs the decrypt operation. The kernel reads AAD data, performs the authencesn scratch write, and copies 4 bytes into the page cache of the target binary. The HMAC fails, but the corrupted memory remains. The process repeats until enough shellcode is injected into the cached binary.
  • Finally, the attacker runs execve("/usr/bin/su"). The kernel loads the modified version from the page cache instead of disk. Since su runs with setuid-root privileges, the injected code executes as root, giving full system control.

The researchers published a demo showing the same 732-byte exploit run on four Linux distributions, where a normal user (uid 1001) consistently gains root access. Tested systems include Ubuntu 24.04 LTS, Amazon Linux 2023, RHEL 10.1, and SUSE 16, covering kernel versions 6.12 to 6.18, all successfully compromised.

“If your kernel was built between 2017 and the patch — which covers essentially every mainstream Linux distribution — you’re in scope.” the researchers wrote. “Copy Fail requires only an unprivileged local user account — no network access, no kernel debugging features, no pre-installed primitives. The kernel crypto API (AF_ALG) ships enabled in essentially every mainstream distro’s default config, so the entire 2017 → patch window is in play out of the box.”

The researchers published a PoC to allow defenders to verify their own systems and validate vendor patches.

Follow me on Twitter: @securityaffairs and Facebook and Mastodon

Pierluigi Paganini

(SecurityAffairs – hacking, Linux)







Source link

Leave a Reply

Subscribe to Our Newsletter

Get our latest articles delivered straight to your inbox. No spam, we promise.

Recent Reviews


The Samsung Keyboard supports glide typing, voice dictation, multiple languages, and deep customization through Good Lock. On paper, it’s a very capable and perfectly functional keyboard. However, it’s only when I started using it that I realized great features don’t necessarily translate to a great user experience. Here’s every problem I faced with the Samsung Keyboard, and why I’m permanently sticking with Gboard as my main Android keyboard.

I have been using Gboard and the Samsung Keyboard on a recently bought Galaxy S24, which I got at a massive discount.

Google’s voice typing doesn’t cut me off mid-sentence

Fewer corrections, fewer cutoffs, faster dictation

I might be a professional writer, but I hate typing—whether it’s on a physical keyboard or a virtual one. I type slower than I think, which I suspect is true for most people. That becomes a problem when I have multiple ideas in my head and need to get them down fast. It’s happened far too often: I start typing one idea and forget the other. Since jacking my brain into a computer isn’t an option (yet), I’ve been leaning more and more on voice typing as the fastest way to capture my thoughts.

Now, both Samsung Keyboard and Gboard support voice typing, but I’ve noticed that Gboard with Google’s voice engine is just better at transcription accuracy. It picks up on accents flawlessly and manages to output the right words. In my experience, it also seems to have a more up-to-date dictionary. When I mention a proper noun—something recently trending like a video game or a movie name—Samsung’s voice typing fails to catch it, but Google nails it.

That said, you can choose Google as your preferred voice typing engine inside Samsung Keyboard, but it’s a buggy experience. I’ve noticed that the transcription gets cut off while I’m in the middle of talking—even when I haven’t taken a long pause. This can be a real problem when I’m transcribing hands-free.

Gboard offers a more accurate glide typing experience

Google accurately maps my swipe gestures to the right words

Voice typing isn’t always possible, especially when you’re in a crowded place and want to be respectful (or secretive). At times like these, I settle for glide (or swipe) typing. It’s generally much faster than tapping on the keyboard—provided the prediction engine maps your gestures to the right word. If it doesn’t, you have to delete that word, draw that gesture again, or worse—type it out manually.

Now, both Samsung Keyboard and Gboard support glide typing, but I’ve noticed Gboard is far more accurate. That said, when I researched this online, I found a 50-50 divide—some people say Gboard is more accurate, others say Samsung is. I do have a theory on why this happens.

Before my Galaxy S24, I used a Pixel 6a, before that a Xiaomi, and before that a Nokia 6.1 Plus. All of my past smartphones came with Gboard by default. I believe Gboard learned my typing patterns over time—what word correlates to what gesture, which corrections I accept, and which ones I reject. After a decade of building up that prediction model, Gboard knows what I mean when my thumb traces a particular shape. Samsung Keyboard, on the other hand, is starting from zero on this Galaxy S24—leading to all the prediction errors. At least that’s my working theory.

There’s also the argument for muscle memory. While glide typing, you need to hit all the correct keycaps for the prediction engine to work. If you’re even off by a slight amount, the prediction model might think you meant to hit “S” instead of “W.” Now, because of my years of typing on Gboard, it’s likely that my muscle memory is optimized for its specific layout and has trouble adapting to Samsung’s.

Swiping vs typing.


Is Swiping Really Faster Than Typing on a Phone Keyboard?

Which typing method reigns supreme?

I mix three languages in one message, and Gboard just gets it

Predictive multilingual typing doesn’t get any better than this

I’m trilingual—I speak English, Hindi, and Bengali. When I’m messaging my friends and family, we’re basically code-mixing—jumping between languages in the same sentence using the Latin alphabet. Now, my friends and I have noticed that Gboard handles code-mixing much more seamlessly than Samsung Keyboard.

If you just have the English dictionary enabled, neither keyboard can guess that you’re trying to transliterate a different language into English. It’ll always try to autocorrect everything, which breaks the flow. The only way to fix this is by downloading a transliteration dictionary like Hinglish (Hindi + English) or Bangla (Latin). Both Samsung Keyboard and Gboard support these dictionaries, but the problem with Samsung Keyboard is that it can only use one dictionary at a time.

Let’s say I’m writing something in Latinized Bangla and suddenly drop a Hindi phrase. Samsung Keyboard will attempt to autocorrect those Hindi words. Gboard is more context-aware. Since my Hinglish keyboard is already installed, I don’t have to manually switch to it. Gboard can detect that I’m using a Hindi word even with the English or Bangla keyboard enabled, and it won’t try to autocorrect what I’m writing. This also works flawlessly with glide typing, which is a huge quality-of-life improvement over Samsung Keyboard.

This isn’t just an India-specific thing either. Code-mixing is how billions of people type every day—Spanglish in the US, Taglish in the Philippines, Franglais across parts of Europe and Africa.

Gboard looks good without me spending an hour on it

I don’t have time for manual customization

Samsung Keyboard is hands down the more customizable option, especially if you combine it with the Keys Cafe module inside Good Lock. You get granular control over almost every aspect of the keyboard—key colors, keycaps, gesture animations, and a whole lot more. While for some users, this is heaven, I just find it too overcomplicated and a massive time sink.

I don’t have the patience to sit and adjust every visual detail of my keyboard. Sure, it gets stale after a while, and you’d want to freshen it up, but I don’t want to spend the better part of an hour tweaking a virtual keyboard. This is where Gboard wins (at least for me) by doing less.

Android 16 brings Material 3 Expressive, which automatically themes your system apps using your wallpaper’s color scheme. With Gboard, all you have to do is change the wallpaper, and the keyboard updates to match—no Good Lock, no manual color picking. It’s a cleaner, more seamless way to keep your phone looking good without putting in the extra legwork.


The keyboard you don’t think about is the one that’s working

I didn’t switch to Gboard because Samsung Keyboard was broken. I switched because Gboard made typing feel effortless. If you’re a Samsung user who’s never tried it, it’s a free download and a five-second switch. You might not go back either.

Pixel 7 with the 8vim keyboard.


I Tried the Weirdest Android Keyboards So You Don’t Have To

Can strange layouts and gestures beat the good old-fashioned QWERTY?



Source link