Nfs2root: A 12-year-old pre-auth remote root in the Linux kernel's NFS server (opens external site)
Comments (91)
4 comments are not loaded here. Read them on Hacker News ↗.
On iPhone or iPad, use Share → Add to Home Screen.
4 comments are not loaded here. Read them on Hacker News ↗.
> Pre-auth heap overflow in the Linux NFS server (nfsd)
> 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.
Then it causes an out-of-bounds crash:
So yet another memory corruption issue that gives the attacker control of the execution and its possible to get root on the system and this is in the kernel itself so "hardening" does not remove the bug.What a disaster.
Replies (1)
Still, just another example of why C code can’t be exposed to the internet.
Replies (6)
Replies (1)
Replies (2)
NFSv4 needs idmapd, which is a different beast altogether.
Replies (2)
Still, getting root on your internal fileserver isn't great.
Replies (1)
This is how you can tell you’re reading a post from a Real Old Time hacker. Hasn’t been that way for a long time.
Replies (2)
Replies (2)
Replies (1)
If someone sets up an NFS server, they know what kind of risk they open themselves up to.
Replies (2)
I don't think preauth RCE is an expected risk of setting up NFS, actually.
Replies (2)
Replies (3)
Continue this thread (1 replies) →
Continue this thread (1 replies) →
Then, you need to add volumes to /etc/exports with allowed hostnames (with lots of parameters for access control).
I'm assuming that anything disallowed by /etc/exports is not allowed, this exploit included.
Replies (1)
Replies (1)
https://www.linuxjournal.com/content/encrypting-nfsv4-stunne...
How little have we learnt since then.
Replies (1)
Replies (2)
Replies (4)
https://portal.anthropic.com/programs/cvp
https://chatgpt.com/cyber
Replies (3)
Replies (2)
(But my optimist hat hasn't been popping out rabbits for some time now...)
Anonymized data is trivial to reattach, and is literally a national security risk. Sort of opposite of my goals in cyber security.
Replies (1)
Replies (2)
Given the pace of LLMs finding vulnerabilities recently, how do you propose anyone will ever be able to establish a track record in the future without already having access? You're describing a system where it's literally impossible for anyone new to ever enter the field (other than a privileged few who work for these AI companies I guess)
Replies (1)
Replies (1)
Replies (1)
0. http://sel4.systems/
Replies (1)
Replies (1)
Replies (1)
Replies (1)
When you run that much code privileged, a few lines more or less does not make a difference.
Linux is not a foundation suitable for security to be built on. Or integrity. Or reliability.
https://github.com/yeet-src/pfw
Here is the specific rule. I just added and confirmed it. (can see the CI).
https://github.com/yeet-src/pfw-rules/blob/53f78fc5823354f4a...
just pull the repo w `pfw pull` then `pfw ls` and apply and you're all set.
Replies (1)
Replies (1)
You can try
`pfw metrics`
To see.
We use a ton of clever JIT compilation techniques to lower code directly onto the NIC
Replies (1)
6.12.117
6.18.61
7.3.2
7.4-rc1
This is CVE-2026-99362
Replies (1)
One has to wonder, however, why Canonical doesn't stick to LTS kernels for their LTS distro. They already offer the HWE kernel for those who need a more up-to-date kernel (whose version is bumped twice a year I think).
Taking on the burden of backporting patches themselves has to have become quite costly (and reckless) in $CURRENTYEAR.
Replies (1)
Replies (1)
Replies (1)
Yes? You're probably safe.
No? You might want to patch this even if you trust the others that have access to it.
Obviously not written with AI in mind, but certainly seems to be true with the many AI eyes on open source at the moment.
Makes me wonder, is the access to the Windows source code one could apply for still a thing? If so, anyone know if there are security firms out there running the same kind of AI deep review for vulnerabilities against it?
From my limited understanding, the NT kernel runs a lot less code at the most privileged level (e.g. drivers), so perhaps that means the chances of finding such escalation vulns are a lot less?
Micro-kernels have always been said to have unsolvable performance problems vs monolithic ones, but have we perhaps entered a time where we are willing to trade off speed for reduced risk? Maybe some orgs running interpreted/JIT'ed languages on Linux would be better served rewriting in more performant ones whilst switching to micro-kernel style OSes, ending up hopefully with at least performance parity to what they had before?
Rewriting large swaths of the Linux kernel (and userspace?) in Rust may also be enough?
(Edited: formatting)
Replies (6)
> access to the Windows source code one could apply for still a thing?
you don't need it, it doesn't matter that much
modern AIs are _incredible_ good at decompiling & reverse engineering to a point where experts in the field have publicly stated it has gotten better then them the "groundwork" (binary -> some kind of sourcode; at least in many "standard" cases)
the reason you mainly see news about AI finding vulnerabilities in open source a huge observation bias.
Mainly:
=> if you non maliciously look for security issues to report & publicize there is a bug preference for OSS (for a variety of reasons)
=> but if you maliciously look for issues you can sell proprietary software is often much more interesting (for a variety of reasons)
=> due to Linux being a critical foundational block for many huge companies there are probably many millions spend on tokens to weed out security issues
=> and for a proprietary code only the company which owns is has a good legal foothold to run analysis on it, any even if they find 1000 CVE worthy bugs, will they report them?? And will they have the same insensitive to spend huge amount of tokens on this?? Probably not always. (It's not that other can't run analysis, as mentioned decom&reverse engineering works super well. But companies threatening to sue you if you did so are not rare. And that is no matter weather they have a legal basis for it or weather you reported it in good will. Sadly being in the right doesn't protect you from abuse by through the legal system. Hence also why security researchers often prefer OSS.)
So it you sum up, if people apply it to OSS it tends to be in the open, if they apply it to closed source it often is not or less public.
BUT this means the arguments "against open source" I have seen in some sources recently really do not add up at all and to some degree it is even the opposite.
if you are supper nit-picky about the definition of the class of vulnerability then yes
but if you look at the relevant "fallout" an attacker can cause then it's not a good point for Windows as you often don't need to actually get RCE in the NT kernel at all to do all the damage you want to do.
Through yes I think the Qubes and similar go in the right direction (VM sandbox everything). And micro kernel which put most work into (sandboxed) user-space seem increasingly like a "insanely good" idea. The "speed tradeoffs" are also often not really a issue at all. (1)
But it also gets increasingly more clear that trusting sandboxes is ... not always the best idea and the best thing to do is to make sure no untrusted code run at all. Sure that often isn't feasible. But for servers there is an increasing case for systems which _can_ only run what you ship and nothing else (2). Only problem is that is inherently in conflict with JIT, scripting languages etc...
---
(1): Micro-Kernels have certain choke points, but outside of some HPC-stuff they might not matter at all and/or can be worked around. E.g. Nintendo Switch might have slow hardware but isn't exactly inefficient in running games on that slow hardware, it has a micro kernel (so has Switch 2). E.g. a surprising amount of web services are run in python which is many magnitudes more a perf. drawback then what micro kernels impose. And even many of the most common web services (e.g. node or java based) might run fast (V8/Java can be reasonable fast) but would work "fine" even if they where 10%-50% slower (and for a lot of stuff we are speaking about ~5% throughput perf. drawback in average, much less if perf. is mostly compute in a small set of data and not moving data). And for LLM servers -5% throughput (between GPU and service) might matter, but you could most likely find a way to work around that, reducing it to a acceptable level not relevant compared to general time spend in the GPU doing compute.
(2): As in: A lot of hardware protections from read xor write memory to stuff which makes turning your code into gadgets or ROP very hard. Then added on top something which makes sure only signed code is loaded into executable memory. And make sure that all code is singed by the OS or your own key. (And yes that only makes sense for headless systems you never login like single service VMs (as it also implies there is no shell or any other capability to run "arbitrary scripts, even if by hand").
Replies (1)
Replies (1)
the attack surface of a (micro)VM is in the end much smaller then for containers, reusing the same kernel comes at a cost (if the kernel isn't kept minimalist and has way more features/apis/etc. then it probably should have)
through as I mentioned in the comment _not_ running untrusted code at all is still the best
I think that has been refuted by Jochen Liedtke's work (L3, then L4 micro kernels).
Replies (3)
Additionally, iDevices OS, Android, macOS, Windows have an hybrid approach, where plenty drivers live in userspace, OS services are implemented in their own processes with IPC (XPC and ports, Android IPC, out-proc COM), with kernel components being virtualised, e.g. Virtualization-based security.
XBox games run on top of an hypervisor, and Swift OrbitOS is a microkernel with capabilities.
It is really only Linux/BSD mindset that is still stuck in the past of monolithic kernels, and is kind of ironic given the cloud workloads using rootless immutable containers.
Enough to eliminate one class of bugs and vulnerabilities, but none of the others.
It was a huge source of vulnerabilities in Windows back in the days and now we see issues in Linux too.
I think linux kernel should not include these scrappy protocols to begin with.
Replies (1)
I must admit NFS on windows has a security history of it's own though, and my "back in the day" may just be a bit farther back than yours. Anyhow, I'm just looking for clarity.
Replies (1)
With so many, they're less novel, less interesting in a sense, so less worthy of effort writing by a human
/s
Replies (3)
No idea about NFS today, but an argument for SMB is that it apparently supports RDMA transfers and no idea if there's any "generic" interface good enough as sendfile that can be extracted yet.
In particular, NFS filehandles are essentially inodes with a generation number, and it requires root to read a file via the inode number. Then you need generation numbers for each inode, which I think is not accessible in userspace even with root (I don't see st_gen in struct stat).
Replies (2)
File handles (unique identifiers for inodes that can be used to reopen a file later) have been exposed to userspace for a long time with name_to_handle_at(2) and open_by_handle_at(2) -- these were originally exposed precisely for userspace nfsd.
The topic of i_version semantics has been discussed recently[1,2]. The kernel's nfsd lies about filesystems that don't support i_version so it's not a hard requirement for a replacement, and as the articles I linked note you can retrieve i_generation via ioctl(FS_IOC_GETVERSION).
And it's important to note that most (if not all) of these are related to optimisations.
[1]: https://lwn.net/Articles/905931/ [2]: https://lwn.net/Articles/937247/
Replies (2)
I was using Ganesha at work because FUSE on macOS had been deprecated, and we were trying to serve the filesystem locally via NFS. We emulated filehandles with an LRU cache.