AI Tools Found a Serious Root Exploit in Linux

The video reveals a serious Linux kernel privilege escalation vulnerability called “copy fail,” discovered with AI assistance, which allows local attackers to gain root access by exploiting a flaw in how the kernel handles page cache and crypto sockets, enabling stealthy overwrites of cached binaries like “su.” It emphasizes the importance of patching affected systems and showcases AI as a powerful tool that enhances expert cybersecurity research rather than replacing human expertise.

The video discusses a serious Linux kernel privilege escalation vulnerability called “copy fail,” discovered with the help of AI tools. This exploit allows an unprivileged user to gain root access on almost any Linux machine deployed since 2017 using just 732 bytes of Python code. Although the exploit requires local code execution first, making single-user desktops and well-secured servers relatively safe, it poses a significant threat to multi-user Linux hosts and shared kernel container clusters where many programs from various sources run simultaneously. The small size of the payload also makes it ideal for use as a Trojan embedded in other programs.

To understand the exploit, the video explains several Linux kernel features involved. The page cache is the kernel’s in-memory copy of file data, used to speed up file reads by avoiding disk access. AFALG is a Linux socket interface that allows user space processes to use the kernel’s crypto API, often with hardware acceleration. It supports zero-copy data movement through splice system calls, which transfer data between file descriptors without copying. Scatter lists are data structures that manage non-contiguous memory chunks as a single buffer for efficient IO, linking the page cache pages to sockets like AFALG.

The exploit works by chaining these features together. An attacker uses splice to move data from a readable file into a pipe and then into an AFALG socket. Due to a flaw, the kernel fails to copy file-backed data into a separate output buffer and instead links the input scatter list directly to the output scatter list. This causes the crypto output buffer to overlap with page cache pages of the file, creating a write primitive. A specific crypto template called “cessin,” used for sequence number support, writes four bytes into what it assumes is safe memory but is actually part of the page cache, allowing the attacker to repeatedly write arbitrary data into cached files.

The proof of concept targets the “su” binary, which allows users to switch to the root account. By carefully overwriting parts of the cached “su” binary in memory, the attacker can execute a corrupted version from the page cache that grants root access without modifying the file on disk. This stealthy approach bypasses file integrity checks since the on-disk binary remains unchanged. The primary mitigation is to patch the kernel with a commit that reverts the 2017 change introducing the bug or disable the algif AEA module required for the exploit.

Finally, the video highlights the role of AI in discovering this vulnerability. The cybersecurity firm Theori used an AI tool called Xent code to assist researchers who already had domain knowledge about the Linux crypto subsystem. The AI helped identify several issues, with copy fail being the most severe. This case exemplifies how AI acts as a force multiplier for skilled professionals rather than replacing them. The video concludes by urging system administrators to stay updated on such vulnerabilities, as the time from discovery to exploitation in the wild is shrinking rapidly.