Anatomy of a Vulnerability: Copy Fail Grants Root Access on All Linux Kernels Since 2017

CVE-2026-31431, dubbed “Copy Fail,” is a local privilege escalation vulnerability in the Linux kernel, identified by researchers from Xint Code and Theori. A mere 732-byte Python script can grant root access across virtually all major distributions released since 2017, including Ubuntu, Red Hat, SUSE, and Amazon Linux. The Cybersecurity and Infrastructure Security Agency (CISA) has added this flaw to its catalog of known exploited vulnerabilities. Patches are available but their deployment varies among distributions.

All it takes is a simple Python script under one kilobyte for an attacker to gain the highest privileges on a Linux system. The vulnerability, labeled CVE-2026-31431 and referred to as “Copy Fail,” affects the algif_aead module within the kernel’s cryptographic subsystem. It impacts all Linux kernels compiled since 2017, representing nearly a decade of Linux infrastructure used in enterprises, government, and cloud environments.

What sets this vulnerability apart is its remarkable portability. Major privilege escalation vulnerabilities in the Linux kernel usually require specific conditions to be met. For instance, “Dirty Cow” depended on achieving a random race condition, while “Dirty Pipe” was limited to certain kernel versions. In contrast, “Copy Fail” executes deterministically, utilizing the same uncompiled Python script on Ubuntu, Amazon Linux, Red Hat, and SUSE. This consistent reliability places it in a unique category compared to others in its class.

A Flaw in the Kernel’s Cryptographic Interface

The origins of CVE-2026-31431 trace back to a modification made in 2017 to the code of the algif_aead module. This module belongs to AF_ALG, the interface that exposes the kernel’s cryptographic primitives to user space without requiring elevated privileges. During that modification, an optimization was introduced allowing the module to perform in-place encryption, reusing the same buffer for both input and output. However, this design includes a logical flaw in the management of dispersion lists.

When a file is transferred through an AF_ALG socket using the splice() primitive, the pages of the kernel’s page cache end up in a modifiable destination list. An unprivileged user can then write four controlled bytes into the page cache of any readable file on the system, including setuid binaries like /usr/bin/su. This modification exists only in memory, within the cache shared among all system processes, leaving no trace written to disk, making it undetectable by integrity monitoring tools based on file hash verification.

The CVSS 3.1 score for this vulnerability is rated at 7.8, which is considered high. The attack vector is local, the exploitation complexity is low, no user interaction is necessary, and the impact is assessed at the maximum level for confidentiality, integrity, and availability.

From 732 Bytes to Root Access

The exploit script published by Xint Code is just 732 bytes long. Written in pure Python, it uses only standard library modules (os, socket, zlib) and requires Python 3.10 to access the os.splice() primitive. There are no compiled binaries, no external dependencies, and no network vectors involved. The exploit chain triggers AF_ALG for the cryptographic interface, employs splice() for page reference transfer, and corrupts the setuid binary in memory to escalate privileges to UID 0.

The Xint Code tool, developed by the Theori team, identified the vulnerability in roughly one hour of scanning the kernel’s cryptographic subsystem using a single operator instruction. Theori is known for its nine victories at DEF CON’s Capture the Flag (CTF) competitions and its third-place finish in the DARPA AI Cyber Challenge finals. This context underscores a measurable dynamic: modern automated code analysis tools are now capable of achieving efficiency levels comparable to specialized offensive research teams within well-defined scopes.

“A local unprivileged user can write four controlled bytes into the page cache of any readable file on a Linux system, subsequently using that capability to gain root rights,” stated the teams at Xint Code and Theori. Derivative scripts from the original proof of concept have already circulated outside of the coordinated disclosure framework. Microsoft Defender has reported preliminary testing activities that could evolve into active exploitation in the days following the publication.

Kubernetes and Cloud Environments at Risk

The Linux kernel’s page cache is shared among all system processes, including those running in containers. This characteristic makes “Copy Fail” a potential container escape primitive. In a Kubernetes environment, a compromised pod can exploit the vulnerability to gain access to the host node, and from there, reach the entire cluster. Microsoft Defender assesses that millions of Kubernetes clusters and a significant fraction of Linux workloads in cloud environments are exposed.

For continuous integration and deployment pipelines, the risk is heightened by the nature of the workloads being executed. These environments regularly run code from third-party repositories or external contributions on shared Linux nodes. In such configurations, the exposure surface to the local vector represented by CVE-2026-31431 is structurally larger than in single-tenant environments. The CISA has included this vulnerability in its known exploited vulnerabilities (KEV) catalog, mandating immediate remediation timelines for U.S. federal agencies.

The CERT-EU has issued an advisory recommending a priority focus on Kubernetes nodes and automation runners. A cautionary note is warranted regarding mitigation measures through the disabling of the algif_aead module using modprobe. In Red Hat family distributions, including Red Hat Enterprise Linux, AlmaLinux, and CloudLinux, this module is compiled directly into the kernel and cannot be disabled using this method. The command executes without error while leaving the system still exposed.

Patches Available, but Where?

As of the publication of the upstream patch in the main kernel source code, major distributions showed disparate levels of readiness. Ubuntu has released patches for its active versions and a mitigation measure in the kmod package. Ubuntu 26.04 (Resolute) and later kernels are unaffected. Red Hat Enterprise Linux, AlmaLinux, CloudLinux, and SUSE had commenced their release cycles but had not finalized them at the time of writing.

For systems unable to immediately apply a kernel update, Microsoft recommends blocking the creation of AF_ALG sockets via syscall filtering mechanisms (seccomp). This approach remains more reliable than disabling through modprobe on distributions where the module is integrated into the kernel. Detection teams should monitor three families of signals. Delayed loading of the AF_ALG protocol several hundred seconds after system startup constitutes an initial indicator. Incomplete entries in auth.log during a su command, with a missing calling username, form a second. Memory-write behaviors on setuid binaries without corresponding disk traces represent a third.

“Copy Fail” serves as a stark reminder for information security professionals. The most feared vulnerabilities in the Linux kernel tend to be simple logic bugs that have existed in the code for years, often discovered not during active exploitation but through methodical analysis. The increasing availability of automated analysis tools capable of working with complex subsystems is shrinking the windows between disclosure, exploit publication, and the first signs of active exploitation.

Scroll to Top