Itdaily - NFS2ROOT: 12-year-old Linux flaw gives remote attackers root privileges

NFS2ROOT: 12-year-old Linux flaw gives remote attackers root privileges

Sticker of the Linux penguin Tux with yellow beak and feet, resting on the keys of a black keyboard.
Image: tomeqs/Shutterstock

A critical vulnerability in the Linux kernel’s NFS server, dubbed NFS2ROOT, has let attackers take full remote control of a Linux server since 2014.

A critical vulnerability has surfaced in the Linux kernel that gives a remote attacker root privileges, the highest privileges on a system. The flaw, tracked as CVE-2026-99362, sits in nfsd. That is the part of the kernel that shares directories via the Network File System (NFS), a protocol that lets other computers on the network use files on a server as if they were stored locally.

Diagram of an attacker breaking into three Linux servers via NFSv4.1 requests and gaining root privileges.
Image: OpenSec

Jérémy Jean, a researcher at the French cyber agency ANSSI, found the flaw and submitted a fix in August. Security firm OpenSec gave the vulnerability the name NFS2ROOT and shared a fully working attack and a patch with the nfsd maintainers at the end of September. The flaw has been in the code since Linux 3.16, a kernel version from 2014.

Server takeover

The issue is a buffer overflow in the kernel’s heap memory. An attacker sends specially crafted requests to the NFS server, which then writes data beyond the block of memory reserved for it. This lets the attacker read kernel memory and bypass KASLR, a protection that randomises where parts of the kernel are located in memory.

The attacker then plants a command in a block of memory that the kernel had already freed. As soon as the attacker closes the NFS connection, the kernel executes that command with root privileges. The attacker needs no account for this, and no action from a user is required.

File servers, NAS devices and Kubernetes

Vulnerable systems run a kernel older than 6.12.117, 6.18.61, 7.3.2 or 7.4-rc1, have nfsd loaded and running with NFS version 4.1 or 4.2, and have TCP port 2049 reachable. The NFS server listens for requests on that port.

“Port 2049 is open on file servers, NAS devices, 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 any login has taken place,” OpenSec writes in its technical analysis of NFS2ROOT.

Update the kernel and restart

Exploitation of the flaw in the wild has not yet been detected. According to OpenSec, an attack leaves no recognisable traces in network traffic. On the server itself, signs of a possible attempt include kernel warnings about nfsd4_check_resp_size, shells spawning kernel processes on a file server, and series of short NFSv4.1 sessions from a single source.

Administrators should install the latest kernel updates from their Linux distribution straight away and then restart the system, so that the patched kernel is actually running. Those who cannot patch immediately should restrict access to port 2049 to trusted clients or networks. If a system does not need to share files via NFS, the nfs-server service can be stopped and disabled.