NFSRoot & NFS2ROOT (CVE-2026-99362): How One TCP Packet on Port 2049 Grants Kernel Root
A twelve-year-old Linux kernel bug turned routine NFS storage into a pre-authentication root exploit. Here is the incident story, the nfsd4_sequence() root cause, classic no_root_squash risks, fleet audit scripts, and the exact production fix.
1. The 3:00 AM Storage Node Alert: Incident Story & Timeline
Most infrastructure teams treat internal file servers as quiet plumbing. A dedicated storage host sits inside a private VPC subnet, exports shared build caches or persistent volumes over TCP port 2049, and runs untouched for years because nobody wants to schedule a reboot on a machine holding terabytes of stateful data. Security scanners often skip internal storage tiers altogether, assuming private RFC 1918 subnets are safe behind a NAT gateway.
That assumption collapsed on November 25, 2026, with the public disclosure of NFS2ROOT (CVE-2026-99362). Consider how a realistic compromise unfolds on a shared platform cluster. At 02:47 UTC, an application container running a third-party webhook parser suffers a minor SSRF or command injection flaw. Normally, an unprivileged container running as UID 10001 inside a hardened namespace poses a contained threat: read-only root filesystem, dropped Linux capabilities, and no Docker socket mounted. Yet that pod sits on a flat Kubernetes overlay network where egress to internal VPC CIDRs is unrestricted.
By 02:51 UTC, the attacker scans the storage subnet for TCP port 2049 and finds an unpatched Ubuntu 22.04 host exporting ReadWriteMany PersistentVolumes via the Linux kernel NFS server (nfsd). No SSH key is stolen. No NFS export is even mounted. A single crafted NFSv4.1 session setup and COMPOUND request triggers a twelve-year-old heap overflow inside kernel space. Seconds later, an on-call SRE notices a kernel slab warning in dmesg, followed by an unexpected outbound TLS session originating from uid=0 on the storage host.
| Timestamp (UTC) | System Layer | Observed Telemetry & Attacker Action |
|---|---|---|
02:47:12 |
Application Pod | Unprivileged pod (UID 10001) is compromised via user-space bug; container cannot escalate locally. |
02:49:40 |
Cluster Egress | Pod probes internal VPC CIDR and discovers TCP port 2049 open on storage-nfs-01. |
02:51:03 |
Linux nfsd |
Crafted NFSv4.1 SEQUENCE call shrinks slot buffer to zero and leaks 3.8 KB of kernel heap to bypass KASLR. |
02:51:09 |
Ring 0 Kernel | Attacker closes TCP socket, firing forged NFS callback pointer as kernel root. |
02:54:22 |
Monitoring / Alert | auditd / Prometheus node exporter flags abnormal outbound connection and /etc/exports modification. |
2. What Are NFSRoot and NFS2ROOT (CVE-2026-99362)?
NFS2ROOT (CVE-2026-99362) is a CVSS 9.8 pre-authentication remote code execution flaw inside the Linux kernel NFS server (nfsd) affecting NFSv4.1 and NFSv4.2 on kernels 3.16 and newer. In Linux systems engineering and offensive security, the broader term nfsroot also refers to two related concepts: classic no_root_squash NFS privilege escalation and kernel boot-time NFS root filesystems (root=/dev/nfs nfsroot=...) used by diskless bare-metal clusters.
Upstream introduced the nfsd heap overflow in March 2014 (Linux kernel 3.16, commit 47ee52986472). It remained hidden across twelve years of enterprise LTS kernels until ANSSI researcher Jérémy Jean reported a Kernel Address Sanitizer (KASAN) crash in August 2026 and security firm OpenSec built a single-connection exploit in September 2026, ahead of public disclosure on November 25, 2026. Because teams searching for nfsroot often encounter both the kernel CVE and legacy export misconfigurations during security audits, understanding all three vectors prevents partial remediation.
| Vector | Auth / Mount Needed? | Root Mechanism | Primary Fix |
|---|---|---|---|
| NFS2ROOT (CVE-2026-99362) | None (TCP 2049 reachability only) | Kernel heap OOB write in nfsd4_sequence() |
Upgrade kernel & reboot; block port 2049 |
Classic no_root_squash |
Mountable share + local client root | Write root-owned SUID binary on exported share | Enforce root_squash & client nosuid |
PXE / Kernel nfsroot= |
PXE boot / network access to rootfs | Modify boot-time /sbin/init or systemd units |
Read-only rootfs exports & VLAN isolation |
3. The Real Impact: Why Kernel-Space RCE Bypasses Everything
When a user-space daemon such as NGINX, Redis, or Node.js suffers a memory corruption bug, platform teams rely on layered OS containment. A compromised worker process stays trapped inside a dedicated service account (like www-data), constrained by Linux namespaces, cgroups, seccomp-bpf syscall filters, and read-only root filesystems. Breaking out of that sandbox requires a second, local privilege escalation exploit.
NFS2ROOT eliminates that boundary because nfsd runs directly in Ring 0 kernel space. There is no user-space wrapper, no container runtime isolation, and no secondary escalation step. Once the forged callback pointer executes, the attacker controls kernel memory across the entire physical or virtual host.
- Zero Credentials & Zero Export Exposure Required: Even if
/etc/exportsis empty or restricted to specific client CIDRs, thenfsdsocket still listens on TCP port 2049 and processes unauthenticated NFSv4.1 session negotiations before checking export permissions. - Kubernetes Storage & CSI Lateral Movement: Clusters running in-cluster NFS provisioners (such as NFS Ganesha or kernel-backed
nfs-subdir-external-provisionerpods with host kernel access) or shared bare-metal storage nodes expose port 2049 across pod subnets unless Kubernetes NetworkPolicies explicitly block egress. - Self-Managed EC2 vs. Managed Cloud Storage: Managed services such as AWS EFS, Azure Files, and Google Cloud Filestore patch their underlying server kernels on the provider side. Self-managed Linux NFS servers on EC2, on-premises VMware clusters, and commercial NAS appliances remain exposed until your team patches and reboots them.
- CI/CD & Artifact Cache Poisoning: Teams sharing build caches or Terraform state artifacts over internal NFS mounts risk silent supply-chain tampering if an attacker gains kernel root on the storage host. Harden pipeline runners and artifact integrity alongside storage using our GitHub Actions security best practices.
In multi-account AWS environments, shared VPC transit gateways often route traffic from developer sandboxes directly into centralized backup subnets. Reviewing network boundaries alongside AWS multi-account isolation patterns prevents low-trust workloads from ever reaching storage ports.
4. Root Cause Analysis: Inside nfsd4_sequence() and Zero-Length Slots
To understand why a twelve-year-old commit created a reliable kernel exploit, look at how NFSv4.1 guarantees exactly-once RPC semantics. Unlike stateless NFSv3, NFSv4.1 introduces stateful sessions managed through a Duplicate Request Cache (DRC) backed by per-session slots.
When a client opens an NFSv4.1 session, it sends a CREATE_SESSION operation negotiating slot parameters, including ca_maxresponsesize_cached—the maximum byte size of a cached reply that the server promises to store in a slot. In vulnerable Linux kernels (3.16 through unpatched 7.3.1), nfsd allows the client to shrink ca_maxresponsesize_cached down to the bare protocol minimum (NFSD_MIN_HDR_SEQ_SZ). That forces nfsd4_alloc_slot() to allocate a zero-length reply buffer (sl_data[]).
Next, the client sends a crafted COMPOUND RPC request carrying a padded XDR tag. Inside nfsd4_sequence(), the kernel narrows the available reply buffer length before validating whether the full encoded response actually fits inside the slot. Because the encoder runs out of space right at the SEQUENCE opcode boundary without aborting cleanly, nfsd copies the full RPC header, COMPOUND header, and tag bytes straight past the zero-length sl_data[] allocation.
- Stage 1 — Unauthenticated Session Setup: The attacker opens a raw TCP connection to port 2049 and negotiates a minimum-size NFSv4.1 session slot.
- Stage 2 — Kernel Heap Out-of-Bounds Write:
nfsd4_sequence()writes roughly 80 bytes (about 61 bytes past the heap object boundary), corrupting adjacent kernel slab metadata. - Stage 3 — KASLR Defeat & Slab Reclamation: OpenSec's exploit research demonstrated how this primitive chains into a 3.8 KB kernel heap information leak to defeat KASLR, followed by a controlled free and forged NFS callback pointer reclamation.
- Stage 4 — Execution on Connection Teardown: Closing the TCP socket triggers the cleanup callback on the forged object, running attacker-controlled instructions directly as kernel
root.
Infrastructure CVE Triage Matrix: NFS2ROOT vs. Recent Linux Disclosures
Platform security teams often patch multiple high-severity advisories within the same maintenance sprint. This comparison shows why NFS2ROOT (CVE-2026-99362) outranks user-space web exploits whenever TCP port 2049 is reachable:
| Vulnerability | Affected Subsystem | CVSS | Privilege Gained | Permanent Fix |
|---|---|---|---|---|
| NFS2ROOT (CVE-2026-99362) | Linux kernel nfsd (TCP 2049) |
9.8 | Immediate Kernel Root | Kernel 6.12.117+ / 6.18.61+ / 7.3.2+ & reboot |
| NGINX2root (CVE-2026-123007) | NGINX HTTP/2 worker + LPE chain | 9.2 | Worker user (needs LPE for root) | NGINX 1.30.7+ / 1.31.9+ & restart |
| HTTP2Shell (CVE-2026-111497) | Brotli C decoder (Node, Python, .NET) | 9.2 | App runtime process user | Patch runtime & strip Content-Encoding: br |
5. Real Example: Classic nfsroot (no_root_squash) vs Kernel RCE
Patching CVE-2026-99362 closes the unauthenticated kernel overflow, yet storage security audits routinely uncover a second, equally lethal flaw on the exact same Linux hosts: no_root_squash inside /etc/exports. Because engineers often search nfsroot when investigating either vulnerability, hardening your exports at the same time eliminates both attack paths.
By default, NFS enforces root_squash: if a client machine connects as UID 0 (root), the NFS server maps those file operations to an unprivileged anonymous account (nobody or nfsnobody). When an administrator adds no_root_squash to simplify backups or legacy Kubernetes mounts, any client with local root can create files owned by the server's real root user—including SetUID (SUID) binaries.
# VULNERABLE: Wide subnet wildcard + no_root_squash enables SUID escalation
/srv/backups 10.20.0.0/16(rw,sync,no_subtree_check,no_root_squash)
# HARDENED: Explicit single-host CIDR, root_squash enforced, and read-only where possible
/srv/backups 10.20.4.12/32(rw,sync,no_subtree_check,root_squash)
# MAXIMUM ISOLATION (for generic app data): Map ALL client UIDs/GIDs to nobody
/srv/shared-assets 10.20.4.0/24(rw,sync,no_subtree_check,all_squash,anonuid=65534,anongid=65534)
In a real red-team audit or lab verification, an engineer tests whether an export leaks root ownership by enumerating shares with showmount, mounting the share on a test client, and inspecting file permissions (you can decode octal SUID modes like 4755 with our Linux chmod permission calculator):
# 1. Enumerate exported shares from an authorized audit host
showmount -e 10.20.1.50
# 2. Check active export flags directly on the NFS server (look for no_root_squash)
exportfs -v
# 3. Defensive Client Hardening: Always mount data-only NFS shares with nosuid,nodev,noexec
# This blocks execution of any SUID binary placed on the share in /etc/fstab:
# 10.20.1.50:/srv/backups /mnt/backups nfs4 defaults,nosuid,nodev,noexec,_netdev 0 0
sudo mount -t nfs4 -o nosuid,nodev,noexec 10.20.1.50:/srv/backups /mnt/backups
On Kubernetes clusters, you can enforce those same defensive client flags across PersistentVolumes by adding mountOptions: ["nosuid", "nodev", "noexec"] to your StorageClass definition. For more host-level Linux inspection workflows, review our essential Linux commands for DevOps engineers guide.
6. How to Audit Linux Hosts, Ansible Fleets & Kubernetes Nodes
Before triggering fleet-wide reboots, determine exactly which hosts load the nfsd kernel module and bind TCP port 2049. Compute workers that only mount remote shares as NFS clients do not run nfsd and are not remotely exploitable via CVE-2026-99362.
# 1. Check the running Linux kernel release
uname -r
# 2. Confirm whether nfsd is loaded and listening on TCP port 2049
lsmod | grep nfsd
ss -tlnp | grep 2049
# 3. Verify active NFS server versions (+4.1 or +4.2 means vulnerable if unpatched)
cat /proc/fs/nfsd/versions
rpcinfo -p localhost | grep nfs
# 4. Hunt kernel ring buffers for slab corruption or unexpected exports
dmesg -T | grep -iE "nfsd|slab|general protection|kasan"
journalctl -k --since "7 days ago" | grep -iE "nfsd|oops|panic"
# 5. Check persistence indicators on exposed storage servers
sudo ls -la /root/.ssh/authorized_keys
sudo systemctl list-unit-files --state=enabled
ss -tupn | grep -v "127.0.0.1"
Across fleets of 20 to 500+ Linux servers, checking hosts manually wastes critical response time. Use an ad-hoc Ansible automation command to inventory kernel versions, active port 2049 listeners, and no_root_squash exports in seconds:
# Audit all Linux hosts in inventory for active TCP 2049, kernel version, and NFSv4.1+
ansible all -b -m shell -a '
echo "HOST=$(hostname) KERNEL=$(uname -r)";
ss -tln | grep -q ":2049 " && echo "PORT_2049=OPEN" || echo "PORT_2049=CLOSED";
[ -f /proc/fs/nfsd/versions ] && echo "NFSD_VERS=$(cat /proc/fs/nfsd/versions)" || true;
grep -H "no_root_squash" /etc/exports /etc/exports.d/*.exports 2>/dev/null || echo "NO_ROOT_SQUASH=NONE"
'
In addition to one-off audits, forward kernel logs and auditd syscall telemetry to your central observability stack so any abnormal outbound socket or export modification fires an immediate alert. See our production monitoring and alerting troubleshooting guide for alert routing and noise-reduction patterns.
7. Production Fix: Kernel Patch Matrix & Emergency Isolation
Upstream resolved CVE-2026-99362 in Linux kernel commit 35ff1a7a7e38 and backported the patch to every active Long-Term Support (LTS) branch. Keep one operational rule in mind: upgrading the kernel package on disk does not patch the running nfsd module in memory. Every vulnerable storage host must complete a full reboot before exposure closes.
| Kernel Branch / Distro | Vulnerable Range | Patched Version | Required Action |
|---|---|---|---|
| Linux 5.10 / 5.15 LTS | Up to 5.10.274 / 5.15.225 | 5.10.275+ / 5.15.226+ |
Upgrade kernel & reboot |
| Linux 6.1 / 6.6 LTS | Up to 6.1.192 / 6.6.162 | 6.1.193+ / 6.6.163+ |
Upgrade kernel & reboot |
| Linux 6.12 / 6.18 LTS | Up to 6.12.116 / 6.18.60 | 6.12.117+ / 6.18.61+ |
Upgrade kernel & reboot |
| Linux 7.3 / 7.4 Mainline | 7.3.0 to 7.3.1 | 7.3.2+ / 7.4-rc1 |
Upgrade kernel & reboot |
| Ubuntu / Debian / RHEL | Unpatched distro kernels | Latest USN / DSA / RHSA | Apply vendor update & reboot |
# Permanent Fix (Ubuntu / Debian)
sudo apt-get update && sudo apt-get install --only-upgrade linux-image-generic
sudo reboot
# Permanent Fix (RHEL / Rocky / AlmaLinux / Amazon Linux)
sudo dnf update kernel -y
sudo reboot
# Verify active kernel version after reboot
uname -r
# Emergency Mitigation A: Stop nfs-server completely if unused
sudo systemctl disable --now nfs-server
# Emergency Mitigation B: Disable NFSv4.1 and NFSv4.2 in /etc/nfs.conf
# Add under [nfsd]:
# vers4.1=n
# vers4.2=n
sudo systemctl restart nfs-server
cat /proc/fs/nfsd/versions
# Emergency Mitigation C: Lock down TCP 2049 to trusted client CIDR only
sudo ufw deny 2049/tcp
sudo ufw allow from 10.20.4.0/24 to any port 2049 proto tcp
Before writing firewall or AWS Security Group allowlists, verify your exact internal IP ranges using our CIDR & subnet calculator so you never accidentally expose port 2049 to an entire /16 corporate or developer network. When patching Kubernetes storage nodes in production, use kubectl cordon and kubectl drain one node at a time to preserve workload availability while kernels reboot, and isolate pod egress to port 2049 using a NetworkPolicy:
# 1. Apply NetworkPolicy restricting TCP 2049 egress to storage-system namespace
cat <<'EOF' | kubectl apply -f -
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: restrict-nfs-egress-2049
namespace: default
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- ports:
- protocol: TCP
port: 2049
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: storage-system
EOF
# 2. Drain, reboot, and uncordon Kubernetes storage nodes one by one
kubectl drain storage-node-01 --ignore-daemonsets --delete-emptydir-data
# (Upgrade kernel and reboot storage-node-01)
kubectl uncordon storage-node-01
If your team manages stateful storage alongside progressive application rollouts, review our Kubernetes architecture and workload orchestration guide and deployment reliability and canary release patterns to keep maintenance windows zero-downtime.
8. NFSRoot & NFS2ROOT Frequently Asked Questions
What is NFSRoot and NFS2ROOT (CVE-2026-99362)?
NFS2ROOT (CVE-2026-99362) is a CVSS 9.8 pre-authentication remote code execution vulnerability in the Linux kernel NFS server (nfsd) affecting NFSv4.1 and NFSv4.2 on kernels 3.16 and newer. The term nfsroot also describes NFS-backed root filesystems and classic no_root_squash privilege escalation chains.
Does an attacker need valid NFS credentials or a mounted share for CVE-2026-99362?
No. Network reachability to TCP port 2049 on a Linux host running nfsd with NFSv4.1 or NFSv4.2 enabled is enough to trigger the kernel heap overflow without mounting a share or authenticating.
Which Linux kernel versions fix CVE-2026-99362?
Upstream fixed the flaw in Linux commit 35ff1a7a7e38, backported to 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.61, and 7.3.2 (plus distro vendor USN, DSA, and RHSA kernel updates). A full reboot is mandatory after installing the package.
Are managed services like AWS EFS vulnerable to NFS2ROOT?
Managed cloud storage services such as AWS EFS patch the underlying storage server kernels on the provider side. Self-managed NFS servers on EC2, bare-metal Linux hosts, NAS appliances, and Kubernetes storage nodes must be patched by your operations team.
How does classic no_root_squash NFS privilege escalation work?
When /etc/exports sets no_root_squash, a client root user keeps UID 0 file ownership on the shared directory. An attacker who mounts the share can write a root-owned SUID binary onto the export and run it on the target host for a root shell.
Does mounting NFS shares with nosuid prevent CVE-2026-99362?
No. Client mount options such as nosuid,nodev,noexec block SUID privilege escalation on mounted shares (mitigating no_root_squash risks), whereas CVE-2026-99362 exploits the nfsd server kernel directly over TCP port 2049 without needing a mount.
How do I disable NFSv4.1 and NFSv4.2 without breaking NFSv3 clients?
Set vers4.1=n and vers4.2=n under the [nfsd] section of /etc/nfs.conf and restart nfs-server. Verify with cat /proc/fs/nfsd/versions that -4.1 and -4.2 are disabled while +3 remains active.
Preparing for Linux Kernel & Zero-Trust Security Scenarios
Practice real-world vulnerability triage and kernel hardening scenarios in our DevSecOps & Zero Trust interview Q&A and Linux & SRE interview questions hubs.
Explore DevSecOps Scenarios →