Nfs2root: A 12-Year-Old Pre-Auth Remote Root Vulnerability Discovered in Linux Kernel NFS Server
Security researchers have recently disclosed a critical, long-standing vulnerability affecting the Network File System (NFS) server in the Linux kernel. Tracked as CVE-2026-99362 and dubbed ‘Nfs2root’, this pre-authentication remote root vulnerability has lurked in the codebase for over twelve years, quietly impacting millions of Linux servers, network-attached storage (NAS) appliances, and Kubernetes storage nodes worldwide.
The flaw originates in the kernel’s handling of NFSv4.1 and NFSv4.2 sessions, specifically within the network input parsing mechanism that runs before any client authentication takes place. The vulnerability allows an unauthenticated remote attacker who can reach port 2049 to execute arbitrary code and gain full root privileges on the target machine. Because the NFS server processes incoming packets directly inside the kernel prior to user verification, it creates a dangerous window of exposure for any system exposing NFS services to a network.
Root cause analysis reveals that the issue stems from flaws in how the server manages reply caches. Each NFSv4.1 session slot caches its last reply to ensure retried requests are handled correctly. However, a malicious client can manipulate this system by shrinking its reply cache to zero bytes, forcing the server to copy a full reply into an undersized buffer located on the kernel heap. This results in a heap-based buffer overflow, enabling an attacker to corrupt adjacent memory structures, leak kernel pointers to bypass defenses like KASLR, and ultimately achieve remote code execution as root.
The vulnerability dates back to a commit introduced in March 2014, which means virtually every Linux kernel released since version 3.16 contained the flaw. This includes numerous long-term support (LTS) releases, distribution kernels, and vendor appliances. Security teams note that automated white-box analysis tools, such as OpenSec’s Antara harness, were able to independently flag the bug, score it a severe 9.8 CVSS rating, and autonomously chain the overflow primitives to spawn a root shell.
Fortunately, upstream maintainers and security contributors have developed and released patches to address the issue. The vulnerability has been officially resolved in Linux kernel versions 6.12.117, 6.18.61, 7.3.2, and 7.4-rc1. System administrators managing affected infrastructure are strongly urged to update their kernels and reboot their systems immediately to mitigate potential exploitation.
For environments where immediate kernel updates are not feasible, administrators can implement temporary workarounds. These include restricting network access to port 2049 using firewall rules to block untrusted connections, or disabling NFSv4.1 and NFSv4.2 protocols entirely within the kernel configuration. Nevertheless, applying the official vendor-supplied security update remains the definitive solution to secure vulnerable hosts against this critical flaw.