Linux

Content type: News

6 min read

12-year-old vulnerability in Linux's NFS server allows remote root without login

News
Reading
6 min
Tables
2
Code
3
In short

CVE-2026-99362 is a heap overflow in nfsd, the NFS server built into the Linux kernel, present since 2014 and only fixed in November 2026. A single unauthenticated connection on port 2049 is enough to become root.

A 2014 flaw published in 2026

CVE-2026-99362 is a pre-authentication heap overflow in nfsd, the NFS server that runs inside the Linux kernel. The bug was introduced in March 2014, by commit 47ee52986472, and shipped in Linux 3.16. It was only fixed and published as a CVE on November 20, 2026, after two independent researchers reached it in different months, one in August and another in September 2026.

The score is 9.8 on CVSS, critical, with vector AV:N/AC:L/PR:N/UI:N: remote attack, low complexity, no privilege or user interaction required. Any Linux host serving NFSv4.1 or NFSv4.2 (the protocol's default versions today) with a reachable tcp/2049 port is exposed. Fixes shipped in kernels 6.12.117, 6.18.61, 7.3.2 and 7.4-rc1.

One connection, no login, full root

NFS runs inside the kernel and processes network input before knowing who is on the other side. That's where the bug lives: a client shrinks its NFSv4.1 session's reply cache to zero bytes and then forces the server to copy an entire response into that empty buffer. The copy happens on the kernel heap, and the client controls a good portion of the bytes copied.

According to the technical report published by security firm OpenSec, the trick lies in the SEQUENCE operation, used to open each NFSv4.1 session. The nfsd4_sequence() function shrinks the response buffer to the size requested by the client before validating whether the slot fits. By filling in the request tag the right way, the attacker makes the buffer fill up right after the SEQUENCE opcode, and the encoder gives up without signaling an error. The server believes everything went fine and stores the entire response, headers included, in a space that had no room for anything.

The report from the security team at ANSSI (the French information systems security agency), which also found the bug independently, documents the flaw with a KASAN alert (the kernel's own address sanitizer):

BUG: KASAN: slab-out-of-bounds in read_bytes_from_xdr_buf+0x1bc/0x390
Write of size 80 at addr ffff888003a549cd
__asan_memcpy+0x38/0x60
read_bytes_from_xdr_buf+0x1bc/0x390
nfsd4_sequence_done+0x5b0/0x810
nfs4svc_encode_compoundres+0x1bf/0x240

80 bytes are copied, 61 of them outside the bounds of the heap object, 40 of them chosen by the very client that made the connection.

From an overflow to a root shell

OpenSec describes the full exploitation chain in five steps, all done with ordinary NFS requests, without requiring any malformed packet outside the protocol:

  1. Overflow: the out-of-bounds write corrupts the control structure of the neighboring slot.
  2. Leak: a replay request returns 3.8 KB of kernel memory, including the KASLR offset (the protection that randomizes memory addresses on every boot).
  3. Free: a forged pointer makes the kernel free an object chosen by the attacker.
  4. Reclaim: that memory space is reallocated with a fake callback, built from NFS client names.
  5. Trigger: the attacker closes the connection; nfsd calls the fake callback, and the kernel executes /bin/sh as root.

In the recording published by OpenSec, the command executed is whoami; id; poweroff -f: the victim's terminal prints root, then uid=0(root), and the machine shuts itself down. The exploit code was not publicly disclosed.

Who found the bug, and how

The flaw was found twice, in different ways, in distinct months of 2026. Jérémy Jean, from ANSSI, reached it manually and submitted the fix to the kernel development mailing list on August 17, 2026, with a KASAN report. OpenSec, for its part, used its automated testing tool called Antara, which flagged the nfsd code path on September 21, assigned the 9.8 score, and on its own built the memory leak, the forged free, and the root shell shown in the video, with no human intervention in the exploitation process.

OpenSec sums up the report's own message in one direct sentence: kernel hardening doesn't eliminate this type of overflow, each host needs to be fixed. The company reported the bug to the NFSD maintainers, Chuck Lever and Jeff Layton, and to the kernel security team on September 22, 2026, already with a complete exploit and a patch in hand.

Who is really exposed

NFS's tcp/2049 port is usually open in places infrastructure teams treat as a "trusted internal network": corporate file servers, NAS appliances, build farms, and Kubernetes cluster storage nodes. That's exactly the assumption this bug topples, since it requires no login or credential at all, just reaching the port.

In Brazil, this hits hard in hybrid environments common at companies that haven't fully migrated to object storage: on-premise NAS shared across teams, NFS volumes used as ReadWriteMany in Kubernetes clusters via a CSI driver, and internal build servers that export directories over NFS to speed up CI pipelines. If the storage network isn't segmented by firewall, any compromised machine on the same VLAN becomes a stepping stone to root across the entire storage.

How to know if your host is vulnerable

OpenSec lists four conditions; all true means exposure today:

ConditionHow to check
Outdated kernel (before 6.12.117, 6.18.61, 7.3.2 or 7.4-rc1, without a distro backport)uname -r
nfsd loadedlsmod | grep -w nfsd
NFSv4.1 or 4.2 enabledcat /proc/fs/nfsd/versions (look for +4.1 or +4.2)
Port 2049 reachable outside loopbackss -ltn 'sport = :2049'

Since the attack uses only valid NFS traffic, there's no network signature that identifies it on its own. OpenSec recommends looking for kernel warnings coming from nfsd4_check_resp_size, oopses with frames from nfsd4_*, svc_* or call_usermodehelper*, shells spawned by kernel worker threads on a file server, and spikes of short NFSv4.1 sessions from the same origin.

Patch, firewall, or disabling NFSv4.1 and 4.2

The definitive fix is to update the kernel and reboot the host. On a distribution, just install the package that lists CVE-2026-99362 in its security notes.

BranchFixed version
6.12 LTS6.12.117
6.186.18.61
7.37.3.2
mainline7.4-rc1

Those who can't reboot today have two temporary options. The first is restricting port 2049 to the storage network only, with a firewall rule:

nft add rule inet filter input tcp dport 2049 ip saddr != 10.20.0.0/16 drop

The second is disabling the vulnerable protocol versions in /etc/nfs.conf:

ini
[nfsd]
vers4.1=n
vers4.2=n

Afterward, restart the nfs-server service. The side effect is losing pNFS and some NFSv4.2 features, so it's only worthwhile as a containment measure, not a final solution.

What remains open

The upstream patch, in commits 5d5a72e965c8 and 241848cc774e, makes the kernel check whether the response fits in the buffer before accepting the slot, and makes the encoder report when something didn't fit. The fix resolves the specific vulnerability, but doesn't change the fact that nfsd still processes unauthenticated network input directly into kernel memory, a design that has existed for more than a decade.

For infrastructure administrators, the case reinforces a practical point: any service that talks to the network before authenticating deserves to sit behind network segmentation, not just a patch. Twelve years is enough time for a bug like this to pass through several audit cycles without being found, and it only surfaced when two different approaches, one manual and one automated, converged on the same piece of code in consecutive months.

Translated from the Brazilian Portuguese original · Read the original