NFS2ROOT: Twelve Years, One TCP Connection, Root
NFS2ROOT: Twelve Years, One TCP Connection, Root On November 25, researchers at OpenSec published a writeup with a video I have now watched twice. An unauthenticated client opens one TCP connection to port 2049 on a Linux box running the kernel NFS server, sends a carefully shaped request, and gets a root shell. No password. No mount. No file handle. No login of any kind. The bug is…
On November 25, researchers from OpenSec published a writeup detailing a critical vulnerability in Linux's built-in NFS server, granting attackers root access with just one TCP connection. This flaw, known as CVE-2026-99362, had been lurking in the kernel since 2014. The bug is caused by a parser trusting the wrong number before verifying the identity of the communicating party.
Linux's NFS server, nfsd, runs in kernel space, making this a kernel-level issue rather than a crash in an external daemon. NFSv4.1 introduced sessions, with each session maintaining cached copies of the last reply to speed up request retries. The vulnerability lies in the design where clients negotiate the size of the cached buffer, resulting in 0-length reply buffers.
When a client sends a compound request with a padded tag, the server mistakenly copies the entire reply, including the header, into the zero-length slot buffer.
The kernel's KASAN report reveals the severity of the issue: an 80-byte write exceeding the heap object's boundary, with 40 bytes determined by the attacker. This write primitive serves as a gateway for the entire exploit chain, including defeating Kernel Address Space Layout Randomization (KASLR), inducing a kernel heap leak, forging structures, and ultimately obtaining a root shell upon connection termination.
The flaw was introduced in Linux 3.16's commit 47ee52986472, and despite being publicly disclosed, no public exploit code is available, and no confirmed exploitation has occurred in the wild. This vulnerability affects unpatched kernels running the NFS server, NFSv4.1 or 4.2 enabled, and accessible from untrusted networks. Containers and cloud instances running NFS services are particularly at risk.
Distributions that haven't released updated packages are also vulnerable. To mitigate the risk, ensure your kernel is patched, firewall port 2049, and avoid running NFS servers on exposed machines. This is not a cause for panic, but rather a reminder to maintain vigilance and promptly apply security patches.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to