Pre-auth remote root in Linux NFS server fixed after 12 years
CVE-2026-99362 allows unauthenticated attackers to gain root access via port 2049 on Linux kernels running nfsd with NFSv4.1 or 4.2.
A critical vulnerability in the Linux kernel’s Network File System (NFS) server has allowed remote, unauthenticated attackers to execute arbitrary code with root privileges for over a decade. Discovered independently by researchers at ANSSI and OpenSec, the bug affects any Linux host running the in-kernel nfsd service with NFSv4.1 or 4.2 enabled. Patches are now available in recent kernel releases, requiring immediate updates and reboots for affected systems.
What happened
The vulnerability, tracked as CVE-2026-99362, is a pre-authentication heap overflow in the nfsd component of the Linux kernel. It has existed since March 2014, when commit 47ee52986472 was merged into Linux 3.16. For twelve years, every kernel version from 3.16 onward, including long-term support (LTS) branches and distribution-specific kernels, carried this flaw. The issue was finally flagged in August 2026 by Jérémy Jean of ANSSI, who submitted a fix along with a Kernel Address Sanitizer (KASAN) report. Shortly after, OpenSec’s automated tool Antara identified the same bug, assigned it a CVSS score of 9.8, and demonstrated a full remote root exploit without human intervention. The CVE was published on November 20, 2026, alongside fixes.
The impact is severe because the NFS server processes network input before authenticating the client. An attacker only needs to establish a single TCP connection to port 2049 to trigger the overflow. This bypasses all user-space security controls, firewalls that allow NFS traffic, and authentication mechanisms. The exploit chain allows an attacker to corrupt kernel memory, leak sensitive data such as the KASLR slide, and ultimately spawn a root shell. In demonstrations, the exploit successfully executed commands like whoami, id, and poweroff -f on the target machine.
How it works
The root cause lies in how NFSv4.1 and 4.2 handle session slots and reply caching. Each session slot caches the last reply to ensure idempotency for retried requests. The client specifies the size of this cache, and the server adjusts its buffer accordingly. In the vulnerable code, the server shrinks the reply buffer to the client-specified limit before accepting the slot. If the client sets this limit to zero bytes, the buffer becomes empty. However, the server still attempts to copy the full reply, including headers and tags, into this zero-byte buffer. This results in an out-of-bounds write on the kernel heap.
Specifically, the server copies 80 bytes, with 61 bytes written past the end of the allocated heap object. Forty of these bytes are controlled by the attacker. The exploit leverages this overflow to corrupt neighboring memory structures. By carefully crafting subsequent NFS requests, the attacker can leak kernel memory contents, free specific objects, and refill them with malicious payloads. Finally, by disconnecting, the attacker triggers a callback that executes their payload as root. The fix introduces a check to ensure the reply fits within the buffer before accepting the slot and forces the encoder to report errors if it cannot fit the data.
Key details
- Severity: CVSS 9.8 Critical (AV:N/AC:L/PR:N/UI:N).
- Attack Vector: Remote, unauthenticated access via TCP port 2049.
- Affected Versions: All Linux kernels from 3.16 (2014) up to the fixed versions.
- Fixed Versions: Linux 6.12.117, 6.18.61, 7.3.2, and 7.4-rc1.
- Exploit Complexity: Low; requires only one TCP connection and standard NFS requests.
- Detection: No unique network signature; look for kernel warnings in
nfsd4_check_resp_sizeor unusual process spawns.
Why it matters
For software engineers and DevOps teams, this vulnerability highlights the risks inherent in legacy kernel components that handle network protocols. NFS is widely used in enterprise environments, Kubernetes clusters, and build farms. Because the exploit requires no authentication, it bypasses typical identity-based security measures. Systems that expose port 2049 to untrusted networks, even indirectly, are at immediate risk. The twelve-year lifespan of the bug underscores the difficulty of auditing low-level kernel code and the importance of regular updates, even for stable LTS kernels.
The automated discovery by Antara also signals a shift in vulnerability research. Tools that can autonomously find and exploit complex memory corruption bugs reduce the time between discovery and weaponization. This means defenders must react faster than ever. Relying on obscurity or minor configuration tweaks is insufficient. The fact that kernel hardening features did not prevent the overflow emphasizes that patching the root cause is the only reliable mitigation. Teams must prioritize kernel updates and restrict network access to NFS services strictly to trusted internal networks.
What you can do
- Check your kernel version: Run
uname -rand compare it against the fixed versions: 6.12.117, 6.18.61, 7.3.2, or 7.4-rc1. - Verify nfsd status: Use
lsmod | grep -w nfsdto see if the NFS server module is loaded. - Check NFS versions: Run
cat /proc/fs/nfsd/versionsto confirm if NFSv4.1 or 4.2 is enabled. - Patch immediately: Update your kernel to a fixed version and reboot the system. For distribution kernels, install the specific update that references CVE-2026-99362.
- Restrict network access: If patching is delayed, use firewall rules to block TCP port 2049 from all untrusted sources. For example, use nftables to drop traffic not originating from your storage network.
- Disable vulnerable protocols: If possible, disable NFSv4.1 and 4.2 in
/etc/nfs.confby settingvers4.1=nandvers4.2=n, then restart the nfs-server service. Note that this may disable pNFS and other features.



