NFS2ROOT — a remotely exploitable vulnerability in the NFS server embedded in the Linux kernel.

A vulnerability (CVE-2026-99362) has been identified in the NFS server (nfsd), which is part of the Linux kernel, allowing remote code execution with kernel privileges without authentication. The vulnerability has been assigned the code name NFS2ROOT and a severity level of 9.8 out of 10 (CVSS). The attack is possible on servers using the nfsd kernel module to handle NFSv4.1/4.2 requests and accepting external network connections on TCP port 2049. Vulnerable configurations can be found in network-attached storage (NAS), file servers, build infrastructures, and Kubernetes storage nodes. Researchers who discovered the issue were able to prepare a working exploit that allows remote root access to server, but the exploit has not yet been published.

Exploiting the vulnerability requires only establishing a single TCP connection with proxy server. The vulnerability is caused by a buffer overflow in the session slot caching code in the implementations of NFSv4.1 and 4.2. The cache retains the last responses server for returning them in case of a repeated request. The size of the cache is determined by the NFS client. When the client sends 0 in the cache size field, the nfsd4_sequence() function on the server reduces the response buffer size to zero, but then attempts to copy the full response into a zero-sized buffer. As a result, 61 bytes of data, of which 40 bytes (headers and tags) are fully controlled by the attacker, overlap the kernel structures that follow the buffer.

In the prepared exploit, the overflow is used to corrupt the control structures of the adjacent slot, which allows for a leak of 3.8 KB of data from the kernel memory during the processing of the next request and to determine the memory layout in the kernel to bypass address space randomization. Then, the pointer structure following it is manipulated to initiate freeing a selected object in the kernel memory. Afterward, the freed memory is replaced with a fake callback handler, composed of names of NFS clients, which is activated when the TCP connection with the NFS server is broken.

The issue emerges starting from Linux kernel 3.16 (2014) and is resolved in releases 6.12.117, 6.18.61, 7.3.2, and 7.4-rc1. The status of vulnerability fixes in distributions can be assessed on the following pages: Debian, Ubuntu, SUSE/openSUSE, RHEL, Gentoo, Arch, Fedora. As a workaround for protection, you can block access to TCP port 2049 on the firewall or disable vulnerable protocol versions in /etc/nfs.conf: [nfsd] vers4.1=n vers4.2=n

To check if the nfsd module is loaded, you can use the command "lsmod | grep -w nfsd," and to determine the versions of protocols processed by NFS — "cat /proc/fs/nfsd/versions." Indirect signs of an attack may include the presence of warnings in logs for nfsd4_check_resp_size, as well as oops errors mentioning structures "nfsd4_*", "svc_*" or "call_usermodehelper*."

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster