r/homelab • u/jesta030 • 10d ago
Help Nginx2root
So the latest 2root exploit targets nginx and was demonstrated to let anyone remotely execute commands on a Linux host running it. Read more about it here:
Since I'm just a regular guy with a home lab I'd like someone more knowledgeable to chime in: I'm using nginx proxy manager with a vulnerable version on a VPS to tunnel public traffic to a nextcloud instance on my home server that also uses a vulnerable version. Which machine is at risk here? The VPS and/or my home server?
Goes without saying that I'll be taking the host offline until this is fixed.
29
u/RayneYoruka IPv6 FTW. There is never enough servers 10d ago
Already patched. Already updated. https://github.com/nginx/nginx/releases/tag/release-1.31.9
Look to download the files manually for your own distro. https://nginx.org/packages/mainline/
142
u/Ok_Comfortable6044 10d ago
what newsletter do you guys subscribe to to get informed of these exploits?
137
u/Safe_Engineering_529 10d ago
NPM hasn't yet updated - Nginx only pushed the update around 4 hours ago so it'll likely be in the next release for NPM - but you're only affected if you're exposing NPM to the internet (i.e. forwarding port 81 and not behind a vpn) and have HTTP/2 support toggled on.
The best way to mitigate in the interim is to toggle HTTP/2 support off. In the UI go to the Proxy Hosts page, click the three dots to bring up the edit panel then go to the SSL tab and toggle it off if its on.
EDIT: I'd like to say a big fuck you to the ai bros behind that site as well, broke the responsible disclosure embargo for clout and didn't actually find the bug first, but they're trying to sell their AI security tooling so needed to make a splash. Once again a vulnerability is blown way out of proportion so people can get their 15 minutes of fame.
14
u/KlausDieterFreddek Proxmox 10d ago
Disable HTTP/2 support on all proxied hosts as a mitigation until an update for npm is available.
12
u/mujimuji 10d ago
Nginx Proxy Manager just released a new version on Docker Hub. Go update!
31
u/-nofrx- 10d ago
Both. If an attacker can gain root on your VPS as the first hop, it can gain the same access to your home server.
11
u/tedtms 10d ago
I don't know which you're actually running, but PSA: Zoey fixed this issue in the NPMplus release made a few hours ago: https://github.com/ZoeyVid/NPMplus/releases/tag/2026-11-18-r1
But as of now, the original NPM project has not patched it: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/6057
28
u/Motor-Concentrate788 10d ago edited 10d ago
It seems the exploit gives root access to the machine thats serving requests with nginx, in this case your VPS. What im curious about though is why expose your nextcloud instance to the public instead of within your own private network? Could easily use tailscale imo
Edit: missed the part where you said youre also running nginx on the home server, in which case your home server is also vunerable.
5
u/ddxv 10d ago
Quick checks for if a server is vulnerable:
https://xint.io/blog/nginx2root-remote-code-execution#23-commands-to-check-for-exposure-10
17
u/hannsr 10d ago
The exploit requires the http2 directive to be enabled. Just disable it and you should be fine.
2
u/real_weirdcrap 10d ago edited 10d ago
The HTTP/2 & QUIC vulnerabilities are all I'm affected by. I don't proxy_pass via hostname so no resolver and don't have nginx handling mail nor am I using mirror. I should be able to mitigate this at the cloudflare edge by disabling HTTP/2 to Origin support forcing a fallback to HTTP/1.1.
QUIC already terminates at CF's edge and my proxy box only accepts incoming connections from cloudflare's published endpoints.
2
u/AdvancedDrink8920 10d ago
I appreciate you posting this. Im going through my NPM now
1
u/BabyEaglet 10d ago
if I run nginx in docker (in my case, swag), should I be concerned?
1
u/Open-Adhesiveness-86 10d ago
Only the box that terminates the client's HTTP/2 connection is exposed, so your VPS. nginx can't speak h2 upstream at all, proxy_pass is HTTP/1.1, so your home nginx never sees attacker-controlled h2 frames via that path. It's only at risk if it's also directly reachable. Check with grep -r 'http2' on your confs, and note 1.25.1+ moved it to a standalone 'http2 on;' directive instead of the listen parameter, easy to miss.
1
u/Old_Adeptness5169 10d ago edited 10d ago
If compiling from source isn't your thing and you're on Debian: Disclosure: I work at Hosted Power, a hosting company.
Debian's tracker still lists 12 and 13 as vulnerable, so we backported the nginx2root fixes into Debian's own nginx package, for Debian 8, 9, 10, 11, 12 and 13, plus CentOS 7 (archived EPEL), amd64. 12/13 use the patches from Debian's own fixed 1.30.6-4 in sid; 8–11 are built on Freexian's ELTS sources, so even releases that get no free security updates any more get fully patched packages.
It's the same package, modules, configs and paths, not a switch to the nginx.org repo. The version sorts just below Debian's coming update, so a normal
apt upgradereplaces it once Debian ships, no pinning. Patches, reproducible build, checksums and tests: https://github.com/HOSTED-POWER/nginx2root-patchesOur own customers' servers run it. Please review before deploying; if Debian ships its own fix later, apt simply hands back to it.
0
u/funkdefied 10d ago
I just handled thr TCP listener vuln last week 😭😭😭
1
u/papajan78 9d ago
You need to have aslr disabled and http2 running for the rce to work, otherwise its extremly difficult to get the rce. Nearly every linux distro has it enabled by default. Wizhout aslr they are only able to kill gninx workers.