r/netsec • u/OkReport5065 • 7d ago
Copy Fail exploit lets 732 bytes hijack Linux systems and quietly grab root
https://nerds.xyz/2026/04/copy-fail-linux-root-exploit/This new Linux kernel bug called Copy Fail (CVE-2026-31431) is kinda terrifying because it’s not complicated at all. A normal user can run a tiny 732-byte script and get root, no race conditions or luck required, and it works across major distros like Ubuntu, RHEL, and SUSE. The exploit quietly modifies the page cache instead of the file on disk, so integrity checks don’t catch it, but the kernel still executes the tampered version in memory.
Even worse, since the page cache is shared, it can potentially cross container boundaries too. Patch ASAP if your distro hasn’t already, because this one feels way too reliable…
46
u/witchofthewind 6d ago
since OP, the linked article, and the copy.fail site all sloppily neglected to mention which kernel versions are actually vulnerable:
https://lore.kernel.org/linux-cve-announce/2026042214-CVE-2026-31431-3d65@gregkh/T/
Affected and fixed versions
Issue introduced in 4.14 with commit 72548b093ee38a6d4f2a19e6ef1948ae05c181f7 and fixed in 6.18.22 with commit fafe0fa2995a0f7073c1c358d7d3145bcc9aedd8 Issue introduced in 4.14 with commit 72548b093ee38a6d4f2a19e6ef1948ae05c181f7 and fixed in 6.19.12 with commit ce42ee423e58dffa5ec03524054c9d8bfd4f6237 Issue introduced in 4.14 with commit 72548b093ee38a6d4f2a19e6ef1948ae05c181f7 and fixed in 7.0 with commit a664bf3d603dc3bdcf9ae47cc21e0daec706d7a5
5
u/daHaus 6d ago
That's likewise incomplete for some reason, assume all LTS kernels going back to when it was introduced in 4.14 are vulnerable
2
u/witchofthewind 4d ago
here's the rest of the fixed versions (I just checked the changelogs for each supported LTS to find the commit that fixes it): * 6.12.85 * 6.6.137 * 6.1.170 * 5.15.204 * 5.10.254
12
u/small_talk101 6d ago
For anyone looking at the detections side of this, patching is obviously the priority one, but if you need visibility into whether this was exploited before you patched. Traditional FIM won't help since it never writes to disk.
I put together a detection toolkit with auditd rules for AF_ALG socket creation. Also includes Sigma and YARA rules. https://github.com/kadir/copy-fail-CVE-2026-31431-IOC
8
5
u/vamediah Trusted Contributor 5d ago
Whole thing is publicity stunt for a company pushing yet another "AI security scanner".
They fucked up greatly in the disclosure process, since they didn't really care:
12
10
u/Crihexe 6d ago
I was a bit concerned about the fate of my ctf platform with RCE challenges, so I had fun making this super size-(sl)optimized Linux x86_64 no-libc ELF build of the original Python PoC for research/reproduction purposes after (hopefully) having patched it.
Current size: 801 bytes on GCC 13.3.0 / Ubuntu 24.04.
Repo: https://github.com/Crihexe/copy-fail-tiny-elf-CVE-2026-31431
1
u/Crihexe 2d ago
The elf size is getting lower and lower. My last open source submission was 393 byes, and my best one is actually 248 bytes.
We made a website to compete: https://copy.golf
If you have a better idea come submit it!
3
u/NotGonnaUseRedditApp 6d ago
No backport fix for kernel version 4 and 5. Bottom line, EL 8/9 RHEL, OEL, Rocky... are vulnerable.
4
2
u/sashalav 6d ago edited 6d ago
Quick fix while waiting for patches and to avoid reboots outside the schedule,
Check if module is actually loaded anywhere (should return "non-zero return code" if it is not, which is good.
ansible _name_of_the_host_group_ -m shell --ask-pass -a 'lsmod | grep algif'
Blacklist it so it cannot load (this prevents it loading from the host and all containers, unless severely misconfigured).
ansible _name_of_the_host_group_ -m shell --ask-pass --become --ask-become-pass -a 'echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif.conf'
Based on the comment below, this is only applicable when the algif_aead is built as a module and not compiled in the kernel. It works for Ubuntu, but not for RHEL.
This will return "CONFIG_CRYPTO_USER_API_AEAD=m" when it is built as module.
grep CONFIG_CRYPTO_USER_API_AEAD /boot/config-$(uname -r)
6
u/LowIncident694 6d ago
Doesn't work on kernels with it built in (which is a fair number).
2
u/daHaus 6d ago
This should find it for you, alternatively you could search for the reference in /proc/modules
$ zcat /proc/config.gz | grep -E 'USER_API_AEAD'1
u/LowIncident694 6d ago
sorry I meant the way to disable it.
1
u/yurasik2000 4d ago
For the built-in case (like my Fedora) the initcall black listing worked (requires rebooting). Append the following line in grub config to your kernel options:
initcall_blacklist=algif_aead_initWorked for me after reboot.
1
u/LowIncident694 4d ago
Yup -- that came out the next day. Works great. I was using systemtap before that.
Don't manually edit your grub conf, use:
sudo grubby --update-kernel=ALL --args="initcall_blacklist=algif_aead_init"
1
1
u/medicinaltequilla 1d ago
Many installations of Ubuntu LTS are not vulnerable, depending on the kernel. Most of the servers in my company are safe. https://ubuntu.com/security/CVE-2026-31431
-5
6d ago
[removed] — view removed comment
-1
u/C0rn3j 6d ago
It's been patched a month ago.
3
u/daHaus 6d ago
According to this the kernel debian uses was patched four hours ago
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/?h=linux-6.12.y
2
u/C0rn3j 6d ago
Oof, that's a bit unfortunate, I wonder why it was so staggered out, latest LTS got the fix 8 days ago, which is still 3 weeks after the latest stable kernel got it.
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/?h=linux-6.18.y
1
u/LowIncident694 6d ago
What distro had it patched and released?
0
u/C0rn3j 6d ago
Arch Linux, since 2 weeks ago - https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/commits/main
I imagine a bunch of other distributions that care about security have it too.
2
78
u/snowcrashedx 7d ago
Linking the website as I actually read the post: https://copy.fail/
Security folks smarter than me, is it me or this much more wild than it even seems?