NFS2ROOT:Linux 核心 NFS 伺服器存在 12 年的未經驗證遠端 root 漏洞
Nfs2root:Linux 内核 NFS 服务器中一个存在了 12 年的无需身份验证的远程 root 漏洞
OpenSec Intelligence 的 Antara 找出 CVE-2026-99362,並展示 Linux 核心 NFS 伺服器的未經驗證堆積溢位可讓遠端攻擊者取得 root shell。
報告説明 NFSv4.1/4.2 的觸發條件、從堆積溢位到 root shell 的利用鏈及修補版本,提供判斷漏洞風險和處置範圍的依據。
PlatformHow it worksResearchWhy OpenSecBenchmarksBlogRequest early access
More
LoginRequest early access
ResearchCVE-2026-99362 CVSS 9.8 · critical
NFS2ROOT: a 12-year-old pre-auth remote root in the Linux kernel's NFS server
If your Linux server speaks NFS, anyone who can reach port 2049 can own it. No password, no account, no click. For 12 years, one TCP connection has been enough to corrupt kernel memory, and OpenSec's Antara turned that into a root shell on its own.
What you need to knowWatch the video
By OpenSec Intelligence Nov 25, 2026·6 min read

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. We pointed OpenSec's Antara at it. It came back with a root shell.
CVSS9.8critical
AdvisoryCVE-2026-99362critical CVSS 9.8
Pre-auth heap overflow in the Linux NFS server (nfsd)
Fixed in Linux 6.12.117, 6.18.61, 7.3.2 and 7.4-rc1. Update the kernel and reboot.
What you need to know
- What: a pre-auth heap overflow in the kernel's NFS server,
nfsd. - Who: any Linux host serving NFSv4.1 or 4.2 (the default) on a reachable tcp/2049.
- Impact: one TCP connection writes 61 bytes past a kernel heap object; chained, that gives a root shell.
- Now: patch and reboot. Until then, firewall tcp/2049.
Key facts
- Severity 9.8 Critical (AV:N/AC:L/PR:N/UI:N)
- Attack Remote, unauthenticated, tcp/2049
- Impact Kernel heap overflow → remote root shell
- Bug age 12 years, since Linux 3.16 (2014)
- Affected In-kernel nfsd with NFSv4.1 or 4.2
- Fixed in 6.12.117 · 6.18.61 · 7.3.2 · 7.4-rc1
One connection, no login#
The NFS server runs inside the kernel and parses network input before it knows who you are. CVE-2026-99362 lives in that gap: a client 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 picks most of the bytes.

How NFS2ROOT reaches a Linux NFS server: one unauthenticated TCP connection to port 2049
Twelve years in a few lines of C#
Timeline
Mar 2014 Commit
47ee52986472narrows the reply buffer while handlingSEQUENCE. It ships in Linux 3.16.2014 to 2026 12 years Every kernel since 3.16 carries it: LTS, distribution and appliance kernels.
17 Aug 2026 Jérémy Jean of ANSSI sends a fix upstream with a KASAN report.
21 Sep 2026 OpenSec's Antara flags the bug, scores it 9.8 and turns it into a root shell on its own.
20 Nov 2026 CVE-2026-99362 is published with fixes.
Watch it run#
A real run, end to end. Left: the victim's console. Right: our client on another machine, talking to the victim only over tcp/2049.
Video
NFS2ROOT recording: an unauthenticated client gets a root shell on a Linux NFS server

The overflow. The kernel warns in nfsd4_check_resp_size, but the out-of-bounds copy has already happened.

Root. The attacker hangs up, and the victim's kernel runs our command: root, then uid=0(root), then power-off.
Root cause#
Each NFSv4.1 session slot caches its last reply, so a retried request is answered exactly once. The client decides how big that cache is.
Set it to the minimum and every slot's buffer is zero bytes. nfsd4_sequence() then 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.
KASAN report from the upstream fix text Copy
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
That is 80 bytes copied, 61 of them past the end of the heap object, 40 of them chosen by the client.

Inside NFS2ROOT: the reply is copied into a slot buffer with no room for it.
The fix checks that the reply fits before taking the slot, and makes the encoder report what it can't fit.
From overflow to root#
The exploit stays private. Each step is an ordinary NFS request:
Overflow The write corrupts the neighbouring slot's bookkeeping.
Leak A replay request returns 3.8 KB of kernel heap, and with it the KASLR slide.
Free A forged pointer makes the kernel free an object we choose.
Reclaim We refill that memory with a fake callback built from NFS client names.
Trigger We hang up.
nfsdcalls the fake callback, and the kernel runs/bin/shas root.
In the recording, that command is whoami; id; poweroff -f: the victim prints root, then uid=0(root), and switches itself off.
Found and proven by a machine#
Antara, OpenSec's white-box harness, flagged the nfsd reply-cache path, scored it 9.8, and built the leak, the arbitrary free and the root shell shown in the video by itself: end to end, with no human in the loop.
Kernel hardening does not remove the overflow. Patch every host.
Am I exposed?#
Tick what's true for your host. All four means exposed, today.
Am I exposed?
- KernelOlder than 6.12.117, 6.18.61, 7.3.2 or 7.4-rc1, with no distribution backport
uname -r
- KernelOlder than 6.12.117, 6.18.61, 7.3.2 or 7.4-rc1, with no distribution backport
- nfsd runningThe in-kernel NFS server is loaded
lsmod | grep -w nfsd
- nfsd runningThe in-kernel NFS server is loaded
- NFSv4.1 or 4.2 onThe list shows
+4.1or+4.2``cat /proc/fs/nfsd/versions
- NFSv4.1 or 4.2 onThe list shows
- 2049 reachableListening on an address other than loopback
ss -ltn 'sport = :2049'
- 2049 reachableListening on an address other than loopback
0 of 4 conditions met
What to do#
Patch and reboot#
| Branch | Fixed in |
|---|---|
| 6.12 LTS | 6.12.117 |
| 6.18 | 6.18.61 |
| 7.3 | 7.3.2 |
| mainline | 7.4-rc1 |
On a distribution kernel, install the update that lists CVE-2026-99362.
Can't patch today? Close 2049#
Only the storage network may reach nfsd Bash Copy
nft add rule inet filter input tcp dport 2049 ip saddr != 10.20.0.0/16 drop
Or turn off NFSv4.1 and 4.2#
/etc/nfs.conf ini Copy
[nfsd]
vers4.1=n
vers4.2=n
Then restart nfs-server. This turns off pNFS and some 4.2 features.
Hunting for it#
The attack is valid NFS, so there is no network signature. Look for:
- Kernel warnings from
nfsd4_check_resp_size, on every attempt, successful or not. - Oopses with
nfsd4_*,svc_*orcall_usermodehelper*frames. - Shells spawned by kernel workers on a file server.
- Bursts of short NFSv4.1 sessions from one source.
Disclosure#
We reported the bug to the NFSD maintainers and security@kernel.org on 22 September 2026 with the full remote-root exploit, and sent a patch the same day. CVE-2026-99362 was published with fixes on 20 November.
Credits#
- OpenSec Intelligence: found the bug with Antara, which escalated it to pre-auth root on its own, and reported it with the full exploit and a patch.
- Jérémy Jean (ANSSI): found it independently and wrote the upstream fix,
5d5a72e965c8and241848cc774e. - Chuck Lever and Jeff Layton: the NFSD maintainers.
References#
nfsd: preflight SEQUENCE replies before accepting a slot The upstream fix for CVE-2026-99362, by Jérémy Jean.github.comnfsd: set op->status when an operation's header cannot be encoded The follow-up guard in the NFSv4 encoder.github.com
- Introduced by 47ee52986472 (Linux 3.16)
- Patch thread
- OpenSec's patch submission
Topics
Share this story
Copy linkShare on XShare on LinkedIn
Written by
OpenSec Intelligence
OpenSec's vulnerability research team.
On this page One connection, no login Table of contents
0% read · 6 min left
One connection, no loginTwelve years in a few lines of CWatch it runRoot causeFrom overflow to rootFound and proven by a machineAm I exposed?What to doPatch and rebootCan't patch today? Close 2049Or turn off NFSv4.1 and 4.2Hunting for itDisclosureCreditsReferences
The OpenSec Dispatch New research and advisories from OpenSec, in your inbox.
Keep reading
Engineering
Pi-Bolt: the same Pi, compiled to native code
How we compile the Pi coding agent ahead of time into one native executable, and why most of the speed came from doing less work: 112× faster large file writes and 13× less CPU while streaming than Pi on Node.
By OpenSec Oct 21, 2026·8 min read
Back to top Close
The OpenSec Dispatch
A clearer view of security.
Research, engineering notes, and updates from OpenSec.
AI-native vulnerability management.
Defensive depth. Offensive reach.
The OpenSec Dispatch
A clearer signal.
Delivered to you.
Research worth reading. Security ideas worth keeping. Product updates that matter.
// 01 Platform// 01 Platform
// 02 Research// 02 Research
// 03 Get started// 03 Get started
© 2026 OpenSec From vulnerability to visibility.PrivacyTermsStatusBack to top
來源:Hacker News 熱門(buzzing.cc 中文翻譯) · opensec.in
