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 CVE-2026-99362. It scored 9.8. It had been sitting in the kernel since 2014.
I build a messenger for a living, or at least I spend most of my nights trying to. My code parses untrusted bytes from strangers all day, so a story about a parser that trusted the wrong number before checking who was talking hits close to home. This one is worth understanding properly, because the mistake it makes is one I have made myself in smaller ways.
What actually happened
The Linux kernel ships its own NFS server, nfsd. If your machine shares files over NFS, the server code runs in kernel space, which means a bug there is not a crash in some daemon you can restart. It is a bug in the kernel itself.
NFSv4.1 added sessions. Each session has slots, and each slot keeps a cached copy of the last reply, so if a client retries a request, the server answers from the cache instead of running the operation twice. Sensible design. The catch is that the client gets to negotiate how big that cache is.
Here is the chain, as the fix describes it:
- A client negotiates
ca_maxresponsesize_cacheddown to the smallest allowed value. Every slot now gets a zero-length reply buffer. - The client sends a COMPOUND request whose tag is padded so the reply buffer fills up right after the SEQUENCE opcode, just before the status word that should follow it.
- The encoder runs out of room and gives up, but without flagging an error. The server believes SEQUENCE succeeded.
- The server then copies the whole reply, RPC header, COMPOUND header, tag and all, into that zero-length slot buffer.
The kernel's own KASAN report from the fix tells the story in one line: an 80-byte write, 61 bytes past the end of the heap object, about 40 of them chosen by the client. That is not a crash. That is a write primitive, and a write primitive in the kernel is the whole game.
OpenSec chained it into a kernel heap leak to defeat KASLR, then a controlled free, then a forged structure, then a root shell on disconnect. Their exploit is private, and as of November 26 there is no public exploit code and no confirmed exploitation in the wild. That matters, and I will come back to it.
Twelve years
The bug was introduced by commit 47ee52986472 in Linux 3.16, in March 2014. It was found independently twice this year: once by OpenSec's automated harness, and once by Jeremy Jean at ANSSI, who also wrote the upstream fix. The CVE was published on November 20. The fix landed in 6.12.117, 6.18.61, 7.3.2 and 7.4-rc1, with backports to 5.10, 5.15, 6.1 and 6.6 following after.
Twelve years is the part that stays with me. This is not some obscure driver for hardware nobody owns. NFS is everywhere: NAS boxes in small offices, build farms sharing caches, home labs, cloud instances. The code was reviewed, the kernel is the most scrutinized codebase on the planet, and a one-line logic error about buffer sizes survived all of it because the bad path only shows up when a client negotiates an absurd value and then pads a tag just so. Nobody writes that test by hand. It takes a fuzzer that is willing to be rude to the protocol, or a second pair of eyes reading the same function with fresh suspicion.
That is the honest lesson, and it is not a comfortable one. If you write parsers, and I do, your code has a path like this somewhere. The question is only whether anyone rude enough has walked it yet.
Who is actually exposed
Four things have to be true at once: an unpatched kernel, nfsd loaded and serving, NFSv4.1 or 4.2 enabled (they are, by default), and port 2049 reachable from an untrusted network. If you only mount NFS shares from other machines, you are a client, and the server-side fix does not concern you. If you run a NAS, a build cache server, or a container that runs the kernel NFS server, it does.
The sneaky group is containers. Images that serve NFS need privileged mode or CAP_SYS_ADMIN and they use the host's nfsd module, so a container you spun up to share a folder can quietly turn your host into an NFS server. And several distributions had not shipped fixed packages when the writeup went out, so "I run apt update" is not a guarantee yet. Check the kernel version you are actually running, not the one your package manager promises.
Until you can patch and reboot, the mitigation is boring and it works: firewall port 2049 so it is not reachable from anything you do not trust. There is no clever middle ground here. The server parses network input before it knows who you are, so there is no authentication setting that saves you.
The part nobody should overstate
I want to be careful about one thing, because the security world is bad at this. No public exploit exists. Nobody has confirmed this being used in the wild. The video is real and the bug is real, but "root over port 2049" is a sentence that makes people picture their laptop being owned through the wifi, and that is not what this is. Your laptop almost certainly does not run nfsd. The machines at risk are servers that share files, and most of those sit behind a firewall already.
That does not make it a non-story. It makes it a story with a shape: a small number of exposed, unpatched servers, a short window before exploit code appears in public, and a fix that already exists. The right response is a patch and a firewall rule, not panic. The wrong response is reading "no public exploit" as "no hurry", because the gap between a published writeup and a public exploit has a habit of being measured in days, and this writeup includes the KASAN trace, the root cause, and a video of the whole chain working.
Why I keep coming back to the same mistake
I spend my time on a post-quantum messenger, where the whole point is that the other side of the connection is untrusted by default. Every time I read a bug like this, I check my own code for the same shape: a size negotiated by the peer, used before it is validated, in a path that runs before authentication. I have found that shape in my own code more than once, and each time it was in a function I thought was too simple to be wrong.
NFS2ROOT is a reminder that "too simple to be wrong" is exactly where these bugs live. A reply cache. A negotiated size. A buffer that shrinks before the check that should have run first. The fix, in the end, is a preflight check: make sure the reply fits before you narrow the buffer and consume the slot. One check, in the right order. Twelve years late, but that is how it goes.
Patch your kernel. Close 2049. And if you write a parser that takes a size from the network, check it before you use it, not after. I am going to go re-read my own SEQUENCE equivalent now.
Sources: OpenSec's NFS2ROOT writeup, the upstream kernel fix for CVE-2026-99362, and the CVE record. No public exploit code exists as of November 26, 2026, and no in-the-wild exploitation has been confirmed.
