Contents

NFS2ROOT Lets One Connection to Port 2049 Take Root on Linux File Servers and Ubuntu Still Has No Fix

 

Ethical Hacking Complete Course Zero to Expert

Hack like black hat hackers. Penetration testing, Kali Linux, WiFi and web hacking, and the hacker mindset behind it.

→ Take the full course
 
Contents

One connection to port 2049 gets root on a Linux file server, with no login. The standard NFS settings are all it takes. The flaw has sat in the kernel since 2014, and an AI built the exploit.

# TL;DR

Port 2049 is where a Linux machine shares its folders over the network. The protocol is called NFS, the Network File System, and on Linux the server side of it runs inside the kernel itself, in a part called nfsd. You find it on file servers, NAS boxes, build servers and the storage nodes behind Kubernetes clusters. For twelve years, the code listening on that port let a client that could reach it write into kernel memory before it had logged in.

On November 25, the security company OpenSec published a video of what that looks like. On the left of the screen is the victim’s console. On the right is a client on another machine that talks to the victim only over TCP port 2049. The client never mounts a share and never logs in. A few requests later, the victim prints root, then uid=0(root), and switches itself off. The command the attacker sent was whoami; id; poweroff -f. The company calls the bug NFS2ROOT. Its official name is CVE-2026-99362, and the Linux kernel’s own CVE team scores it 9.8 out of 10. That score means it can be reached over the network without an account or a password, and without a person on the server clicking or opening anything.

To see how one connection gets that far, start with what NFS does when the network is unreliable. A client asks the server to do something, for example create a file. If the answer gets lost on the way back, the client simply asks again. The server should not create the file twice. So since NFS version 4.1, it keeps a copy of its last answer in a small buffer for each slot in a session, and a repeated request gets that stored answer back. This buffer is called the reply cache, and the client gets to say how big it should be when it opens its session.

A client can set the reply cache to the smallest size the server allows, and then each slot gets a buffer of zero bytes. Next it sends a request with a label in front of it, a field called the COMPOUND tag, and it makes that label exactly long enough that the server’s answer no longer fits. The server stops writing its answer halfway, but nothing marks that as an error. It treats the request as a success and copies the complete answer, headers and label included, into a buffer that has room for nothing. Writing past the end of a piece of memory that the kernel handed out while it was running is called a heap overflow.

KASAN, the kernel’s memory checker, caught that overflow in the report that came with the fix:

1
2
BUG: KASAN: slab-out-of-bounds in read_bytes_from_xdr_buf+0x1bc/0x390
Write of size 80 at addr ffff888003a549cd by task kunit_try_catch/24

That is 80 bytes copied. According to the researchers, 61 of them land past the end of the memory block, and 40 of those 61 are chosen by the client, because they come straight out of its own label.

No password is needed because of the order in which things happen. The attack uses three requests, EXCHANGE_ID, CREATE_SESSION and SEQUENCE, and the server allows all three before it looks at a file or checks who may use a shared folder, which NFS calls an export. The CVE record spells out the rest: the server copies the user ID that the client puts in its request without checking it, and it also accepts requests that carry no credentials at all. The overflow happens in the code that reads network input before the server knows who is on the other end.

Corrupting memory is one thing, and turning it into a root shell takes more steps. The researchers describe them in their write-up, and each step is an ordinary NFS request:

  • → The overflow damages the bookkeeping of the slot next to it in memory
  • → A repeated request makes the server send back 3.8 KB of kernel memory, and with it the KASLR offset, the random shift Linux gives its own memory layout each time it starts, so that an attacker cannot predict where things are
  • → A forged pointer makes the kernel free a piece of memory the attacker picked, and the attacker refills that memory with a fake callback, an address the kernel will jump to later, built out of NFS client names
  • → The attacker hangs up, the server calls the fake callback, and the kernel runs /bin/sh as root

The researchers keep the exploit itself private.

The flaw goes back to March 12, 2014. That day J. Bruce Fields wrote a change to make the NFS server simpler: instead of checking each reply against the limits of a session, the server would shrink its reply buffer to the session size up front. According to his own commit message, the change also fixed an older bug in how those limits were counted. It went into Linux 3.16, and the kernels released since then carry the flaw.

The same change rewrote the function that checks reply sizes, nfsd4_check_resp_size, and gave it a warning for a case that was not supposed to happen. Twelve years later, warnings from that function are the first trace the researchers tell administrators to look for. The first attempt after a boot leaves one in the kernel log, whether the attack works or not. After that the log stays quiet until the next reboot, because the kernel prints that warning only once. By the time the warning is printed, the copy past the end of the buffer has already happened.

The person who found the bug is Jérémy Jean of ANSSI, the French national cybersecurity agency. He sent a fix to the kernel’s public mailing list on August 17, 2026, with the report from the memory checker attached. Chuck Lever, one of the two maintainers of the Linux NFS server, took it into his own copy of the code on September 14. The fix is small. Before the server accepts a slot, it now checks that the fixed part of the answer, plus room for an error code, fits within the limit the client negotiated. If it does not fit, the request ends with an error and the slot and its cache stay exactly as they were, which is what the NFS 4.1 specification asks for.

The maintainer added a second change in the same series. When the start of an answer no longer fits in the reply, the code that writes each reply now reports that as an error instead of carrying on. A second place in the code can also shrink the reply buffer, in the path that sends back file data. His commit message says it is not proven that a request can ever reach that limit, so he calls the change a guard rather than a fix.

A week later, on September 21, an AI tool called Antara, built by the company behind the video, flagged the same piece of code. According to the company, it scored the bug 9.8 and then built the memory leak, the forged free and the root shell from the video by itself, from start to finish, without a person stepping in. The company reported the bug on September 22 to the NFS maintainers and the kernel’s security team, together with the complete exploit and a patch of its own. It calls its find independent, and by the dates, the fix from France was already in the maintainer’s copy of the code at that point. In the final version of that fix, committed again on October 5, one of the company’s researchers is listed as having tested it.

The fix itself has an AI in it too. At the bottom of the commit, directly above its author’s sign-off, is this line:

1
Assisted-by: Codex:gpt-5

It records that an AI coding tool helped write the patch. The kernel’s own guidelines ask contributors to say so when a tool produced a meaningful part of a change, and they state that an AI may never sign off a patch. A person has to do that, and that person answers for each line of it. So one AI turned a bug from 2014 into a root shell, and another one helped write the code that ends it.

The fix has been public since August. The first of the stable kernels that distributions build on to carry the fix, 6.18.61, came out on November 6, and the CVE was published on November 19. Debian ships fixed kernels for its current release, trixie, and for the older bookworm through its security updates. The regular bookworm repository still carries version 6.1.176, which the project’s own tracker lists as vulnerable, so a bookworm server only gets the fix from the security repository.

Red Hat rates the bug Critical. It released fixed kernels on November 26 and 27 for Enterprise Linux 8 and for two extended-support releases of version 10, while version 9 is still listed as affected. SUSE lists the issue as pending. On the newer CVSS 4.0 scale it scores the bug 9.0, and it marks the attack as needing a basic user account and a specific setup on the target, where the kernel team says no account is needed.

Ubuntu is further behind. On its own security page for this CVE, last updated on November 25, the main Linux kernel package is listed as Vulnerable on six long-term support releases: 16.04, 18.04, 20.04, 22.04, 24.04 and 26.04. Long-term support releases are the versions built to run on a server for years. For 26.04 and the newer 26.10, there is a short note that work is in progress. For the other five, there is no note at all.

This is the second time this month. On November 3, I wrote about another Linux kernel bug with a score of 9.8, CVE-2026-98432, in the code that answers incoming TCP connections. An AI built that exploit as well, and on that day Ubuntu’s page listed three of its long-term support releases as Vulnerable, while Debian had shipped the fix eighteen days earlier. That bug is fixed on Ubuntu now. For this one, Ubuntu’s long-term support releases are back on Vulnerable, six of them this time.

Older systems have it worse. The kernel of Enterprise Linux 7 reports version 3.10, a number older than 3.16, and it is still on the affected list. CentOS Linux 7 runs that same 3.10 kernel and reached its end of life on June 30, 2024. Since that date, the project publishes no updates for it, so a file server on it will not get this fix through its own updates.

Your machine is only exposed when four things are true at the same time, and the researchers give a command to check each one. The kernel is older than the fixed versions, with no fix carried back by the distribution. The NFS server module is loaded. NFS version 4.1 or 4.2 is switched on, which is the default. And the server listens on port 2049 on an address other than localhost:

1
2
3
4
uname -r
lsmod | grep -w nfsd
cat /proc/fs/nfsd/versions
ss -ltn 'sport = :2049'

In the output of the third command, +4.1 or +4.2 means those versions are on.

A standard install of Enterprise Linux does not run the NFS server, so a machine that does not share folders is not exposed. A machine that only mounts a share from somewhere else, as a client, is not affected either, because the bug is in the server. A machine on the same internal network that can reach port 2049 can send these requests too, so a file server that never faces the internet is still at risk, including from a machine an attacker already controls.

The fix itself is a new kernel and a reboot, because the old kernel keeps running in memory until the machine restarts. After the reboot, uname -r shows which version is running. If you cannot patch a server today, the researchers give two other options:

  • → Let only the storage network reach port 2049, for example with nftables:
1
nft add rule inet filter input tcp dport 2049 ip saddr != 10.20.0.0/16 drop

That rule only checks IPv4 addresses, so a server that also has IPv6 needs the same limit for its IPv6 traffic.

  • → Or switch off NFS 4.1 and 4.2 in /etc/nfs.conf and restart nfs-server, which also switches off pNFS along with 4.2 itself:
1
2
3
[nfsd]
vers4.1=n
vers4.2=n

If the machine does not need to share folders, the NFS server can be stopped and kept from starting again:

1
2
systemctl stop nfs-server
systemctl disable nfs-server

The attack is made of valid NFS requests, so there is no network signature to search for. The researchers list what does show up on a file server that was hit: warnings from nfsd4_check_resp_size, kernel error reports, called oopses, with nfsd4_*, svc_* or call_usermodehelper* in the trace, shells started by kernel worker threads, and bursts of short NFSv4.1 sessions from a single source.

In the kernel’s own releases, the fix is in Linux 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.61 and 7.3.2, and in 7.4-rc1. On a distribution kernel, the version number can mislead, because distributions carry fixes back into their own older kernels, so the distribution’s page for this CVE is the one to check. So far there is no public report of the bug being used in an attack. It does not appear in the list of known exploited vulnerabilities kept by CISA, the US cybersecurity agency, and the exploit from the researchers has not been released.

A single Nmap scan of your own home network shows you which machine, if any, is listening on port 2049 right now.

My Ethical Hacking Complete Course Zero to Expert takes you there step by step: reconnaissance, scanning, exploitation and traffic analysis, hands-on, from your first day with no Linux or hacking background.

→ Join my complete ethical hacking course

Hacking is not a hobby but a way of life.

Sources:

OpenSec: NFS2ROOT (CVE-2026-99362) | CVE-2026-99362 record | Linux kernel fix commit | Ubuntu CVE-2026-99362

 
NEWSLETTER

Stay updated

Get the latest posts in your inbox every week. Ethical hacking, security news, tutorials, and everything that catches my attention. If that sounds useful, drop your email below.

By Bulls Eye

Jolanda de koff • email • donate

My name is Jolanda de Koff and on the internet, I'm also known as Bulls Eye. Ethical Hacker, Penetration tester, Researcher, Programmer, Self Learner, and forever n00b. Not necessarily in that order. Like to make my own hacking tools and I sometimes share them with you. "You can create art & beauty with a computer and Hacking is not a hobby but a way of life ...

I ♥ open-source and Linux