Threats

12-year-old Linux NFS vulnerability gives remote root over port 2049

Adam Bream
By Adam Bream , Tech Content Writer
12-year-old Linux NFS vulnerability gives remote root over port 2049
Cover © Anonhaven

A 12-year-old Linux NFS vulnerability gives remote root to anyone who can reach port 2049. The bug, CVE-2026-99362, sits in nfsd, the NFS server built into the kernel, and carries a CVSS score of 9.8. No password, account or user action is needed.

OpenSec published the full NFS2ROOT breakdown on November 25, 2026, at 19:52 UTC. Its research team, OpenSec Intelligence, added an exploitation video and hunting guidance. About 12 hours later, at 08:10 UTC on November 26, watchTowr released its own FAQ on the flaw.

Any Linux host that serves NFSv4.1 or 4.2 over a reachable tcp/2049 is exposed. Those protocol versions are the default. According to watchTowr, the CVE record marks every kernel from 3.16 onward as affected with no extra configuration. OpenSec counts a port as reachable if it listens on any address other than loopback, so internal networks count too.

"Port 2049 sits open on file servers, NAS appliances, build farms and Kubernetes storage nodes. Since 2014, the Linux kernel listening on it has let anyone who can reach it write into kernel memory before logging in."

— OpenSec Intelligence, NFS2ROOT advisory, November 25, 2026

The flaw dates to commit 47ee52986472 from March 2014, which shipped in Linux 3.16. It changed how nfsd narrows its reply buffer while handling the SEQUENCE operation. All LTS, distribution and appliance kernels since then carry the bug, according to OpenSec.

NFSv4.1 sessions are split into slots, and each slot caches its last reply. A retried request gets the same answer exactly once. The client chooses how big that cache is.

The attack starts there. According to the official CVE description, a client can negotiate ca_maxresponsesize_cached down to NFSD_MIN_HDR_SEQ_SZ. The function nfsd4_alloc_slot() then gives every slot a zero-length sl_data[] buffer. Next, nfsd4_sequence() shrinks the reply buffer to that cached limit before it accepts the slot sequence ID.

A padded COMPOUND tag does the rest. The client sizes the tag so the shrunken buffer holds the SEQUENCE opcode but not the status word after it. In that state nfsd4_encode_operation() returns without calling nfsd4_encode_sequence(), so cstate.data_offset stays at zero. The operation status also stays at nfs_ok, and the server treats the whole request as a success.

A cache safeguard misses the error too. According to the CVE description, nfsd4_store_cache_entry() declines to cache a lone SEQUENCE that returned an error. That test reads the status the operation reported, so here it passes and the reply heads for the slot cache.

nfsd then copies the full reply from offset zero into the empty slot buffer. That copy includes the RPC and COMPOUND headers and the client's own tag. Jean's upstream fix carries a report from KASAN, the kernel memory sanitizer, captured in a KUnit test run (task kunit_try_catch/24). It shows a slab-out-of-bounds write of 80 bytes at address ffff888003a549cd. The stack runs through __asan_memcpy, read_bytes_from_xdr_buf+0x1bc/0x390, nfsd4_sequence_done and nfs4svc_encode_compoundres.

61 of the 80 bytes land past the end of the heap object, and the client chooses 40 of the 80.

"Because the bytes written past the buffer come largely from the client's own request, a remote client can corrupt memory inside the Linux kernel over an ordinary network connection."

— watchTowr, NFS2ROOT FAQ, November 26, 2026

watchTowr adds that the server sends much of that overwritten data back to the client in its reply.

OpenSec keeps its exploit private but describes the chain in five steps, each an ordinary NFS request. The overflow first corrupts the bookkeeping of the neighbouring slot. A replay request returns 3.8 KB of kernel heap, which leaks the KASLR slide (the random offset that hides kernel addresses). A forged pointer next makes the kernel free an object the attacker picks.

The freed memory is refilled with a fake callback built from NFS client names. When the attacker hangs up, nfsd calls that callback and the kernel runs /bin/sh as root. In OpenSec's recording the command is whoami; id; poweroff -f, and the victim prints root, then uid=0(root), and switches itself off. The kernel logs a warning in nfsd4_check_resp_size, but only after the out-of-bounds copy has happened.

OpenSec credits the exploit to Antara, its automated white-box testing harness. The company says Antara flagged the nfsd reply-cache path on September 21 and scored it 9.8. It then built the heap leak, the arbitrary free and the root shell "with no human in the loop." That claim comes from OpenSec alone. No third party has confirmed it, and the exploit code has not been released.

Jérémy Jean of ANSSI, the French national cybersecurity agency, found the same bug independently. He sent a fix upstream with a KASAN report on August 17, 2026, five weeks ahead of Antara. On September 22, OpenSec reported the flaw to NFSD maintainers Chuck Lever and Jeff Layton and to security@kernel.org. It attached the full exploit and its own patch.

Jean wrote both upstream patches. The main one, commit 5d5a72e965c8, is titled "nfsd: preflight SEQUENCE replies before accepting a slot." Debian's tracker lists the same CVE fix in mainline as commit 35ff1a7a7e38 (7.4-rc1).

Before narrowing the buffer and consuming the sequence ID, nfsd now checks that the fixed-size SEQUENCE result fits the negotiated limit. It also leaves room for the error status of a following operation. When that check fails, the slot and its cached reply stay unchanged, as RFC 8881 Section 2.10.6.1.2 requires for an error returned from SEQUENCE.

The follow-up patch, commit 241848cc774e, is titled "nfsd: set op->status when an operation's header cannot be encoded." It makes the encoder report what it cannot fit.

kernel.org, acting as the CVE numbering authority, published the record on November 19, NVD shows. OpenSec dates it November 20. NVD has not yet added its own score, so the 9.8 rating (vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) comes from kernel.org.

Kernel branch First fixed release
5.10 5.10.275
5.15 5.15.226
6.1 6.1.193
6.6 6.6.163
6.12 LTS 6.12.117
6.18 6.18.61
7.3 7.3.2
Mainline 7.4-rc1

OpenSec names 6.12.117, 6.18.61, 7.3.2 and 7.4-rc1 as the patched releases. watchTowr and NVD add backports for older branches, namely 5.10.275, 5.15.226, 6.1.193 and 6.6.163.

Distribution kernels lag behind. Debian has fixed trixie (6.12.117-1, with 6.12.118-1 in security), forky (7.3.5-1), sid (7.3.6-1) and the separate linux-6.12 package for bookworm (6.12.117-1~deb12u1). The main bookworm kernel is still marked vulnerable in both 6.1.176-1 and the security build 6.1.192-3. The linux-6.12 update for bookworm came through advisory DLA-4927-1.

Ubuntu kernels still unpatched

Ubuntu rates CVE-2026-99362 as Critical priority. Its page, updated November 25, marks the main kernel vulnerable in every release from 16.04 to 26.10. Work is in progress on 26.04 (7.0.0-45.45) and 26.10 (7.3.0-12.13). Until an update lands, close port 2049 or switch off NFSv4.1 and 4.2.

Ubuntu's HWE (hardware enablement) kernels are on the list too. The page marks linux-hwe (16.04), linux-hwe-5.4 (18.04), linux-hwe-5.15 (20.04), linux-hwe-6.8 (22.04) and linux-hwe-7.0 (24.04) as vulnerable. Only the stock 14.04 LTS kernel is listed as not affected. Its linux-lts-xenial HWE kernel is marked vulnerable.

As of November 26, nobody has reported exploitation in the wild, watchTowr says. The flaw is not in the CISA Known Exploited Vulnerabilities catalog.

Earlier Linux root bugs covered by AnonHaven needed a foothold first. The nine AppArmor flaws and the snapd bug on Ubuntu Desktop both required a local unprivileged user. NFS2ROOT needs only a TCP connection to the storage port.

Teams often treat NFS on an internal segment as safe because it never faces the internet. With NFS2ROOT, any machine that can reach port 2049 becomes a path to root on the file server. A compromised build agent or Kubernetes pod is enough.

— AnonHaven Editorial Team

OpenSec offers four checks, and a host that meets all four is exposed today. The kernel is older than the fixed releases with no distribution backport (uname -r). The in-kernel server is loaded (lsmod | grep -w nfsd). The output of cat /proc/fs/nfsd/versions shows +4.1 or +4.2. Finally, ss -ltn 'sport = :2049' shows a listener on an address other than loopback.

Administrators need to update the kernel and reboot. watchTowr advises confirming after the reboot that the running kernel matches or exceeds the fixed version. On distribution kernels, OpenSec advises installing the update that lists CVE-2026-99362.

Hosts that cannot be patched today need port 2049 closed to everything but the storage network. OpenSec's nftables example is nft add rule inet filter input tcp dport 2049 ip saddr != 10.20.0.0/16 drop. The subnet should match the local storage range.

OpenSec's other fallback is to switch off NFSv4.1 and 4.2. Admins set vers4.1=n and vers4.2=n in the [nfsd] section of /etc/nfs.conf and restart nfs-server. That turns off pNFS and some 4.2 features.

"Kernel hardening does not remove the overflow. Patch every host."

— OpenSec Intelligence, NFS2ROOT advisory, November 25, 2026

Detection is harder. OpenSec warns that "the attack is valid NFS, so there is no network signature." Its researchers suggest watching for kernel warnings from nfsd4_check_resp_size, which fire on every attempt, successful or not. Kernel oopses with nfsd4_*, svc_* or call_usermodehelper* frames are another sign. So are shells spawned by kernel workers on a file server and bursts of short NFSv4.1 sessions from a single source.

Have a story? Become a contributor.

We work with independent researchers and cybersecurity professionals. Send us a tip or submit your article for editorial review.

Questions on the topic

What is the NFS2ROOT Linux NFS vulnerability?
NFS2ROOT (CVE-2026-99362) is a CVSS 9.8 heap overflow in nfsd, the Linux kernel NFS server, present since Linux 3.16. Anyone who reaches tcp/2049 on a host serving NFSv4.1 or 4.2 can corrupt kernel memory, and OpenSec says it turned that into root.
Which Linux kernel versions fix CVE-2026-99362?
Fixed releases are 6.12.117, 6.18.61, 7.3.2 and 7.4-rc1, with backports in 5.10.275, 5.15.226, 6.1.193 and 6.6.163. Each host must reboot into the updated kernel.
How can I protect a Linux NFS server if I cannot patch yet?
Restrict tcp/2049 to the storage network with a firewall rule, or set vers4.1=n and vers4.2=n in the [nfsd] section of /etc/nfs.conf and restart nfs-server.