NFS2ROOT Linux Flaw Gives Attackers Root Without a Password After 12 Years
NFS2ROOT Linux Flaw Gives Attackers Root Without a Password After 12 Years
A single network connection to a Linux file server was enough to take it over completely. Security researchers have disclosed a critical flaw in the Linux kernel’s NFS server that lets an unauthenticated attacker obtain a root shell, with no password, no account, and no click from anyone on the server. The NFS2ROOT Linux flaw, tracked as CVE-2026-99362 and rated 9.8 out of 10 in severity, sat undetected in the kernel for 12 years before it was found twice in the same year, once by a human researcher and once by an artificial intelligence testing harness.
The flaw affects any Linux host running the in-kernel NFS server, known as nfsd, with NFS version 4.1 or 4.2, the default in many distributions. All an attacker needs is to reach the server’s port 2049 over the network. From there, a carefully shaped request corrupts kernel memory, and a short chain of further requests turns that corruption into full control of the machine.
The vulnerability was introduced in March 2014, in a commit that shipped with Linux 3.16, and every kernel since has carried it. Fixes have now been released, but the disclosure is a reminder of how long even a severe bug can hide in the most scrutinised code in the world, and how many systems may still be running unpatched.
One Connection, No Login
The danger of the flaw starts with where the vulnerable code runs. The NFS server is not an ordinary program that can crash and be restarted. It lives inside the kernel itself, and it parses network input before it knows who is on the other end of the connection.
That gap is where CVE-2026-99362 lives. A client connecting to port 2049 can shrink its reply cache to zero bytes, then make the server copy a full reply into it. The copy lands on the kernel heap, and the client chooses most of the bytes that get written.
The attack needs no login and no mounted share. The client never has to prove who it is, and the server never gets a chance to check. The three requests involved, EXCHANGE_ID, CREATE_SESSION and SEQUENCE, are all allowed before the server looks at a file or checks who may use a shared folder. The flaw is in the code that reads network input, which runs before any authentication takes place.
In a demonstration published by the security firm OpenSec Intelligence, an unauthenticated client on one machine connected to a Linux server over a single TCP connection to port 2049. A few requests later, the victim’s console printed root, then uid=0(root), and the machine switched itself off. The command the attacker had sent was whoami; id; poweroff -f.
How a Zero-Length Buffer Breaks the Kernel
The root cause sits in the way NFS version 4.1 handles sessions. Each session has slots, and each slot keeps a cached copy of the last reply, so that if a client retries a request, the server can answer from the cache instead of running the operation twice. The client is allowed to negotiate how large that cache is.
That design is sensible, but the negotiation has no safe floor. Set the cache size to the minimum and every slot’s reply buffer becomes zero bytes long. The server then runs SEQUENCE, the operation that starts the session, and shrinks its own reply buffer to that negotiated limit before accepting the slot.
The attacker then pads the request’s tag, the label on a bundled COMPOUND request, so that the reply buffer fills up exactly after the SEQUENCE opcode and just before the status word that should follow it. At that point the encoder runs out of room and gives up, but without flagging an error. The server believes SEQUENCE succeeded, because nothing told it otherwise, and caches the whole reply, including the RPC header, the COMPOUND header and the tag, into a buffer with room for nothing.
The kernel’s own memory checker, KASAN, captured the result in the report that accompanied the upstream fix: an 80-byte write, 61 bytes past the end of the heap object, about 40 of them chosen by the client, because they come straight from its own tag. Writing past the end of a block of memory the kernel set aside for one purpose, landing on whatever sits next to it, is called a heap overflow. In this case, the neighbouring object is another session slot, and its bookkeeping is exactly what the attacker wants to corrupt.
The fix checks that the reply fits before the server accepts the slot, and makes the encoder report what it cannot fit. Both changes close the gap that let the silent failure turn into an overflow.
From Overflow to Root Shell
Corrupting memory is one thing. Turning that corruption into a root shell takes more steps, and the researchers demonstrated each of them using ordinary NFS requests. OpenSec has kept the exploit itself private, but it has described the chain in its advisory.
First, the overflow damages the bookkeeping of the neighbouring slot. Next, a replayed request returns 3.8 kilobytes of kernel heap, and with it the KASLR slide, the randomisation that hides where things live in kernel memory. Then a forged pointer makes the kernel free an object of the attacker’s choosing. That freed memory is refilled with a fake callback built from NFS client names. Finally, the attacker hangs up, and when the connection closes, nfsd calls the fake callback, and the kernel runs a shell as root.
The whole sequence is valid NFS traffic. There is no malformed packet for a firewall to spot and no unusual protocol for an intrusion detection system to flag. The attack looks, at the network level, like a client doing normal file-sharing work.
As of late November, there was no public exploit code and no confirmed exploitation in the wild. That is reassuring, but it is also a narrow window. The technical details are now public, and the researchers’ video shows the attack working end to end, which means capable attackers can be expected to reproduce it.
Found Twice, Once by a Machine
The flaw’s discovery story is almost as striking as the flaw itself. It was found independently by two researchers in 2026, twelve years after it was introduced.
Jérémy Jean, a researcher with the French security agency ANSSI, found the bug in August 2026 and sent a fix upstream with a KASAN report. His fix was merged into the mainline kernel on September 14.
Separately, OpenSec’s AI-powered security testing harness, called Antara, flagged the nfsd reply-cache path on September 21, scored the bug 9.8, and built the leak, the arbitrary free and the root shell by itself, end to end, with no human in the loop. OpenSec reported the bug to the NFS maintainers and to the kernel security team on September 22, submitting its own patch the same day.
Because it takes time for every supported kernel branch to backport a fix, the flaw was not disclosed publicly until the patches were ready. CVE-2026-99362 was published with fixes on November 20, and OpenSec published its full write-up and demonstration video on November 25.
The episode is a sharp illustration of what automated security testing can now do. The code had been reviewed for years by the people who maintain the most scrutinised codebase on the planet, and a one-line logic error about buffer sizes survived all of it. The bad path only appears when a client negotiates an absurd value and then pads a tag just so, a combination nobody writes as a test by hand. It took a harness willing to be rude to the protocol, and a second pair of eyes reading the same function with fresh suspicion, to find it.
Who Is Affected
The exposure is broad. Any Linux host serving NFS version 4.1 or 4.2 on a reachable port 2049 is affected if its kernel is older than the fixed versions. That includes file servers, network-attached storage appliances, build farms and Kubernetes storage nodes, many of which share files over NFS by default.
Four conditions together mean a host is exposed: a kernel older than the fixed releases, with no distribution backport; the in-kernel NFS server loaded; NFS version 4.1 or 4.2 enabled; and port 2049 reachable from an untrusted network. System administrators can check the first three with uname -r, lsmod and the contents of /proc/fs/nfsd/versions, and the last with a listening-socket check.
The fixed kernel versions are 6.12.117, 6.18.61, 7.3.2 and 7.4-rc1, with backports to the older stable branches 5.10.275, 5.15.226, 6.1.193 and 6.6.163. On a distribution kernel, the update to install is the one that lists CVE-2026-99362. A reboot is required for the new kernel to take effect.
Distribution updates take time to reach every system, and that lag is the real risk now. The fix has existed for weeks, but a fix that is not installed protects nobody. Servers that expose NFS to the internet, or to networks where untrusted users can reach port 2049, are the most urgent cases.
What to Do Now
The advice from the researchers is direct: patch the kernel and reboot. Kernel hardening does not remove the overflow, OpenSec warned, and there is no configuration change that fixes the underlying bug. Patching every host is the only complete answer.
For systems that cannot be patched today, the immediate step is to close port 2049 to everything except the storage network, using firewall rules that drop traffic to the port from any address outside the trusted range. That limits the attack to machines that are already inside the trusted network, which is where NFS traffic belongs in the first place.
A second option is to turn off NFS versions 4.1 and 4.2 in the server configuration and restart the NFS service. That removes the vulnerable code path, at the cost of losing pNFS and some version 4.2 features. It is a trade-off, but for a file server that does not need those features, it is a reasonable one while waiting for a patch window.
Detection is harder than prevention. Because the attack is valid NFS, there is no network signature to look for. The signs to watch for are kernel warnings from nfsd4_check_resp_size, which appear on every attempt, successful or not; kernel crashes with nfsd4, svc or call_usermodehelper frames; shells spawned by kernel workers on a file server; and bursts of short NFS version 4.1 sessions from a single source.
Twelve years is a long time for a flaw this severe to go unnoticed. The kernel has carried it since 2014, through every release, every review and every audit. It was found only when a machine was pointed at the code and allowed to test it without assumptions about how a client should behave. The lesson for anyone running a Linux file server is plain: update the kernel, close port 2049 to the outside world, and do not assume that old code is safe code.
Frequently Asked Questions
What is the NFS2ROOT Linux flaw?
NFS2ROOT is the name given to CVE-2026-99362, a pre-authentication heap overflow in the Linux kernel’s NFS server. It lets anyone who can reach a server’s port 2049 corrupt kernel memory and obtain a root shell, with no password or account.
How severe is CVE-2026-99362?
It is rated 9.8 out of 10, critical. The score reflects that it can be reached over the network, needs no privileges and no user interaction, and gives full root access to the affected machine.
Which systems are affected?
Any Linux host running the in-kernel NFS server with NFS version 4.1 or 4.2 enabled and port 2049 reachable. The bug has been present since Linux 3.16, released in 2014, so almost every kernel from the last 12 years is affected unless patched.
How was the flaw discovered?
It was found independently twice in 2026: by Jérémy Jean of the French security agency ANSSI in August, and by OpenSec’s AI testing harness Antara in September, which built a working root-shell exploit by itself with no human in the loop.
How do I protect my server?
Update to a fixed kernel, 6.12.117, 6.18.61, 7.3.2 or 7.4-rc1, or a distribution backport that lists CVE-2026-99362, and reboot. If patching is not possible today, firewall port 2049 so only the trusted storage network can reach it, or disable NFS versions 4.1 and 4.2.
