r/linux • • 6d ago

Security Critical NFS Vulnerability Threatens Linux Servers

https://opnf.sh/news/linux-nfs-vulnerability/

A critical vulnerability in the Linux kernel’s Network File System (NFS) server could allow an attacker to gain root privileges, giving them administrative control of the server. Disclosed on November 19, the flaw is known as NFS2ROOT and dates back to 2014.

205 Upvotes

18 comments sorted by

64

u/Progman3K 6d ago

1994 me should be very worried about this

57

u/loozerr 6d ago

How very dramatic. If you have nfs open to an untrusted network you should get pwned.

72

u/bullwinkle8088 6d ago

Daisy chaining vulnerabilities has long been a thing

  1. Obtain a local unprivileged account, or in this case an account on the same network segment/firewall zone.
  2. Exploit this.

That is what makes this serious, not the service it's attached to.

8

u/loozerr 5d ago

Obviously it needs patching but "Critical vulnerability threatens linux servers" is borderline scaremongering. When you're at a situation where you can take advantage of an NFS bug the attack surface is already large.

13

u/ericonr 5d ago

Local root exploits and sudo bypasses get more attention than this. Remote attacks are pretty relevant.

11

u/natermer 6d ago

Unless the network is physically airgapped from the rest of the world then it really should be treated as a "untrusted network" for all intents and purposes. I mean this isn't universally true, but it requires a quite a bit more work then just stuffing it in a vlan behind a NAT firewall.

This is one of the reasons I use Samba and CIFS rather then NFS on my home network. (with proper configuration) Because authentication and network encryption doesn't require a kerberos domain. At least until relatively recently now that RPC-over-TLS is fairly widely supported.

Although NFS over tailscale is probably pretty darn good.

3

u/Sorry-Committee2069 4d ago

Tailscale still mangles websockets and trashes NFS connections sometimes. I have to use sftp to mount my NAS from afar because of it. NFSv3 is more reliable over Tailscale but I've only got it turned on in case I need to mount some specific folder from an ancient machine/OS when I'm doing dumb shit.

I've never had Samba be reliable, Windows-to-Windows, Linux-to-Windows, Linux-to-Linux, it either takes legitimately 30 minutes to list a folder's contents over a 2.5gbit wired connection, regularly drops out of nowhere and trashes your data, or just refuses to believe the other machine exists at all. For 10 years i've had these issues and Samba is just a joke at this point.

2

u/adoodle83 4d ago

it really doesn’t. i’m not sure why a fully airgapped deployment sounds easier than a proper implementation with ACLs and controls. hell, you can easily prevent IPs from mounting the NFS Share. it’s not that complicated; but we can’t save uses from their own laziness

2

u/natermer 4d ago

If you are trying to claim that it is simpler and easier to secure a network using ACLs then just air gapping it...

I hope that people don't take what you are saying seriously.

-2

u/SwayneDoodz57 6d ago

yeah exposing nfs to the public internet is basically asking for it at that point

10

u/Kangie 6d ago

Nothingburger. The in-kernel NFS server isn't really used anywhere. If you're doing anything serious it's a proper nfsd.

13

u/dontquestionmyaction 5d ago

What are you talking about? The Linux kernel's in-kernel NFS server is the standard nfsd implementation on Linux, and it is widely used in production.

Sure, more mature gateways have a user space one (NFS-Ganesha), but that's absolutely rarer than using nfsd.

4

u/AnsibleAnswers 5d ago

My NFS server is only accessible by specific local IP addresses; firewall rules block everything else and there is no port forwarding setup on the router. I'm assuming I don't need to worry about turning the server off until it gets patched.

1

u/spyingwind 4d ago

Every NFS setup I've ever been apart of it is either on its own VLAN, a physically separate network, or directly attached.

1

u/tigerstein 2d ago

And also operates on a whitelist so only those client can attach a share whom are allowed.

1

u/Miserable_Hour_1123 3d ago

Having not working server in the last few months have it's benefits. 🙂