RC RANDOM CHAOS

An unauthenticated client gets root on Linux NFS servers

CVE-2026-99362 is a pre-auth heap overflow in the Linux kernel NFS server, exploitable to remote root over tcp/2049 since 2014. Patch and reboot.

· 3 min read
An unauthenticated client gets root on Linux NFS servers

Since 2014, any Linux host serving NFSv4.1 or 4.2 on tcp/2049 has let an unauthenticated client write 61 bytes past a kernel heap object, 40 of them attacker-chosen. CVE-2026-99362 is a pre-auth heap overflow in nfsd, the in-kernel NFS server, rated 9.8 (AV:N/AC:L/PR:N/UI:N). One TCP connection, no login, and the chained exploit ends in a root shell.

The bug shipped in Linux 3.16 and rode along in every kernel since: LTS, distribution and appliance builds alike. Fixes landed in 6.12.117, 6.18.61, 7.3.2 and 7.4-rc1. Patch and reboot.

How one connection overflows the heap

Each NFSv4.1 session slot caches its last reply so a retried request gets answered exactly once, and the client decides how big that cache is. Set it to the minimum and every slot’s buffer is zero bytes.

nfsd4_sequence() shrinks the reply buffer to that limit before it accepts the slot. Pad the request’s tag so the buffer fills right after the SEQUENCE opcode and the encoder quits without flagging an error. The server believes SEQUENCE succeeded and caches the whole reply, headers and tag included, into a buffer with room for nothing. That is 80 bytes copied, 61 past the end of the heap object.

The upstream fix from Jérémy Jean of ANSSI checks that the reply fits before taking the slot. A follow-up guard makes the encoder set op->status when it can’t encode a header, so the success path can no longer lie about what it wrote.

From overflow to root

OpenSec published the mechanics of the chain and kept the working exploit private. Every step is an ordinary, valid NFS request:

  • The overflow corrupts the neighbouring slot’s bookkeeping.
  • A replay request returns 3.8 KB of kernel heap, and with it the KASLR slide.
  • A forged pointer makes the kernel free an object of the attacker’s choice.
  • That memory is refilled with a fake callback built out of NFS client names.
  • The client hangs up. nfsd calls the fake callback, and the kernel runs /bin/sh as root.

In OpenSec’s recording the command is whoami; id; poweroff -f. The victim prints root, then uid=0(root), then powers itself off.

The discovery is its own story. OpenSec credits the full chain to Antara, its white-box harness, which flagged the nfsd reply-cache path, scored it 9.8, and built the leak, the arbitrary free and the root shell with no human in the loop. Jérémy Jean of ANSSI found the same bug independently and wrote the upstream fix.

What to do

Install the distribution kernel update that lists CVE-2026-99362 and reboot. Kernel hardening does not close the hole, so a hardened but unpatched host is still exposed.

If you can’t patch today, firewall tcp/2049. Or disable NFSv4.1 and 4.2 and restart nfs-server, which also turns off pNFS and some 4.2 features.

Hunting for it

The attack is valid NFS, so there is no network signature. On the host, look for kernel warnings from nfsd4_check_resp_size, which fire on every attempt whether it succeeds or not; oopses with nfsd4_*, svc_* or call_usermodehelper* frames; shells spawned by kernel workers on a file server; and bursts of short NFSv4.1 sessions from a single source.

OpenSec reported the bug to the NFSD maintainers and [email protected] on 22 September 2026, with the full remote-root exploit and a patch the same day. CVE-2026-99362 was published with fixes on 20 November. Port 2049 sits open on file servers, NAS appliances, build farms and Kubernetes storage nodes, and the vulnerable code behind it is twelve years old.

Share

Keep Reading

Latest on the Wire

Full wire →

New signal daily · RSS

Stay in the loop

New writing delivered when it's ready. No schedule, no spam.