CVE-2026-31431 is a critical vulnerability in Linux's copy-on-write mechanism that exposes rootless containers to data exfiltration via a novel 'Copy Fail' attack vector. The flaw affects Linux distributions from 5.10 to 5.18 and has a potential impact on containerized workloads and cloud infrastructure.
Overview
The vulnerability exploits the interaction between the kernel's copy-on-write and the container's rootless namespace. Patches are available, but widespread adoption remains uncertain. To understand the vulnerability, it's essential to analyze the shellcode embedded in the public exploit.
Analyzing the Shellcode
The shellcode is a compressed and hex-encoded string that, when decompressed, forms a fully formed ELF executable. The exploit overwrites the beginning of /usr/bin/su with this tiny binary, which, when executed, loads the corrupted pages from the page cache and runs the malicious ELF instead of the legitimate utility.
Containment by Rootless Containers
The exploit was tested inside a rootless container using Podman. Although the exploit successfully overwrote /usr/bin/su in the page cache, executed the shellcode, and escalated to root inside the container, the rootless container architecture contained the escalation. The kernel allows setuid(0) to succeed because UID 0 inside the namespace is a valid identity, but it is mapped to an unprivileged host user.
The User Namespace UID mappings ensure that the container's root is mapped to an unprivileged host user, preventing the exploit from modifying host system files, accessing /etc/shadow, or interacting with host processes outside the namespace boundary. This containment is exactly the kind of scenario rootless architectures were designed for.
Tradeoffs
While rootless containers provide a layer of isolation, they may not be suitable for all use cases. The use of User Namespaces requires careful consideration of the tradeoffs between security, performance, and complexity. However, for those running OpenShift, enabling User Namespace support for pods can provide the same UID mapping isolation demonstrated here with rootless Podman.
In conclusion, the CVE-2026-31431 exploit is contained by rootless containers, and the use of User Namespaces provides an additional layer of isolation. As the cloud infrastructure and containerized workloads continue to evolve, it's essential to consider the tradeoffs and implement the necessary security measures to prevent similar exploits.