A 732-byte Python script that imports only os, socket, and zlib from the standard library turns any unprivileged local user into root on every mainstream Linux distribution built since 2017. That is CVE-2026-31431, published as Copy Fail on 2026-04-29. The same exploit binary works unmodified across distributions, and the published run shows four distributions giving up four root shells in one take.
The bug is a single logic flaw in the kernel's authencesn handling, reached through the AF_ALG crypto socket interface and driven with splice() into a 4-byte write to a page-cache page. It is a straight-line logic error, so it does not depend on winning a race or knowing a kernel-specific offset, which is why one script covers roughly nine years of kernels. The exploit edits the page cache of a setuid binary (/usr/bin/su by default, or another passed as argv[1]), so the next su returns a root shell. That page-cache edit does not survive a reboot, but the root shell it gives you is real.
Root cause is a 2017 in-place optimization in algif_aead that allowed page-cache pages to land in the writable destination scatterlist. AF_ALG is a userspace front door to the in-kernel crypto API, and it ships enabled in essentially every mainstream distribution's default config, so the entire window from 2017 to the patch is exploitable out of the box. The only precondition is an unprivileged local account, with no network access, kernel debugging features or pre-staged primitives required.
The page cache is shared across the whole host, so inside containers this crosses tenant boundaries: a pod with the right primitives can compromise the node. That puts shared-kernel infrastructure at the top of the list. Shared dev boxes, jump hosts, build servers and shell-as-a-service let any user become root. CI runners that execute untrusted pull-request code as a regular user (self-hosted GitHub Actions runners, GitLab runners, Jenkins agents) let a PR become root on the runner. Notebook hosts, agent sandboxes, serverless functions and any tenant-supplied container let a tenant become host root. Single-tenant production where only your team has shell is a lower tier, where this is an internal privilege step-up that chains with a web RCE or stolen credentials.
Patch to a kernel package that includes mainline commit a664bf3d603d, which reverts the 2017 optimization so page-cache pages can no longer reach the writable destination scatterlist. Most major distributions are shipping the fix.
Before you can patch, disable the module:
# echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif.conf
# rmmod algif_aead
For most systems this breaks nothing measurable. dm-crypt/LUKS, kTLS, IPsec/XFRM, in-kernel TLS, SSH, the kernel keyring, and default builds of OpenSSL, GnuTLS and NSS all call the in-kernel crypto API directly and never touch AF_ALG. What can break is userspace that was explicitly pointed at AF_ALG: OpenSSL with the afalg engine turned on, some embedded crypto-offload paths, and applications that bind aead/skcipher/hash sockets directly. Confirm with lsof | grep AF_ALG or ss -xa before you pull the module. Anything that was using it falls back to a normal userspace crypto library, which is what nearly everything else already does.
For untrusted workloads (containers, sandboxes, CI), block AF_ALG socket creation with seccomp whether or not the host is patched. That removes the attack surface without depending on kernel version.
The disclosure moved quickly: reported to the kernel security team on 2026-03-23, patch committed to mainline on 2026-04-01, CVE assigned 2026-04-22, public on 2026-04-29. Xint Code says it surfaced the flaw with about an hour of scan time against the kernel's crypto/ subsystem. The PoC is published (sha256 a567d09b15f6e4440e70c9f2aa8edec8ed59f53301952df05c719aa3911687f9) so you can verify your own hosts and confirm a vendor patch actually closes it; run it only on systems you own or are authorized to test, and not on production.
Top comments (0)