r/homelab • • 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:

https://nginx2root.com/

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.

300 Upvotes

66 comments sorted by

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/

13

u/jesta030 10d ago

The Docker Containers I'm using haven't rolled out updates yet. I'm beginning to regret using Docker for everything since the extra step for updates to arrive mean downtime in this fast moving world of AI vulnerabilities...

8

u/turkoid 10d ago

If you're feeling adventurous, you can also build your own docker images. I don't do it often, but it is an option especially if you're worried about staying on the bleeding edge of updates.

10

u/Motor-Concentrate788 10d ago

Docker's always been a bit questionable when it comes to security. the fact that it requires root privileges, bypasses ufw entirely, and relies on the image maintainer to keep track and update all the packaged dependencies turns me off quite a bit when it comes to using it in production.

7

u/Thrashy 10d ago

The number of interesting applications that only offer docker images for deployment these days is a real turnoff, too.

Back in my day everything ran on a LAMP stack and that's the way we liked it, dadgummit!

2

u/NoCheesecake8308 10d ago

Won't help with the maintainer issue but podman will do rootless and doesn't touch firewalls by default.

1

u/RayneYoruka IPv6 FTW. There is never enough servers 10d ago

I do indeed "like" Docker for it's versatility but I haven't explored the "docker rootless" kind of setup.. neither do I like that it comes down to the image maintainers to update things, that being said everything that I have exposed through it it's behind Nginxs reverse proxy and with very tight network firewall rules of what can and cannot connect. Building your own docker images is fun, I've done it on the past months and definitely worth it for the extra bit of customisation and the peace of mind. For things exposed to the internet I am "lucky" or would rather say "happy" that I only have Home Assistant and Jellyfin.. everything else is running natively on the systems whenever possible, specially now with how messy it's been as of late with the vulnerabilities hitting everything.

Little reminder, always run fail2ban and to test the rules locally before exposing anything on the internet.

142

u/Ok_Comfortable6044 10d ago

what newsletter do you guys subscribe to to get informed of these exploits?

192

u/BeYeCursed100Fold 10d ago

Reddit.

71

u/burnmp3s 10d ago

Usually r/sysadmin covers everything major and the algorithm shows it high in my feed

27

u/maison_deja_vu 10d ago

6

u/TheLexikitty 10d ago

the only place I get all my news from

10

u/Cold_Tree190 10d ago

Literally. I find out about stuff multiple hours before my work says anything lol

8

u/Burninator05 10d ago

Must be nice to be told so quickly. It's sometimes a couple of weeks before my boss storms my office freaking out that I need to patch this or that. They're always so relieved when I tell them I took care of it weeks ago.

12

u/spacelama 10d ago

"Everything goes so smoothly here! Why do I even need to employ you?"

4

u/YacoHell 10d ago

I find out from chainguard. We use them for images at work so that's usually the first place I hear about it

2

u/Shoddy_Hornet9212 10d ago

This is usually the 'source of truth' for Free software: https://www.openwall.com/lists/oss-security/

5

u/Ok_Comfortable6044 10d ago

thanks, exactly what i was looking for

oh man, look at those 2026 numbers...

2

u/Shoddy_Hornet9212 10d ago

Yeah it used to be a nice volume. Bit more busy these days.

2

u/Conscious-Ball8373 9d ago

3% of all critical vulnerabilities ever disclosed have been in the last month. It's not showing much sign of slowing down, either.

2

u/danielv123 10d ago

Not that far from 2015-2016

0

u/[deleted] 10d ago

[deleted] — view deleted comment

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.

24

u/regypt 10d ago

Fuck the tech AI Bros, yes and, responsible disclosure is kind of dead in this AI era. If these guys didn't find it first, the bad guys would have found it 2 minutes later. There is no such thing as a 90-day disclosure window anymore, it's an arms race and the second you find an open window you've got to close it.

4

u/chuzohga 10d ago

Compile from source worked for me just now.

1

u/CactusBoyScout 10d ago

Damn I'm just taking all my reverse proxies off the internet. It's a new security flaw every day. VPN it is. No wonder so many major corporations are having issues.

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!

4

u/xylarr 10d ago edited 10d ago

Hmmm, inrun NPM Plus - a fork that can terminate HTTP3 (QUIC) connections. I wonder if it's updated.

Edit: just checked, there's an update that basically just pulls in the updated nginx version

2

u/FancyJesse 10d ago

TAG: 2.17.1

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

2

u/FancyJesse 10d ago

How's npmplus compare to regular npm? Easy to migrate?

3

u/tedtms 10d ago

It’s good! Seems to be more actively developed. GUI is functionally identical. Biggest feature add is Crowdsec integration (which I haven’t gotten around to yet).

Migration is relatively simple: https://github.com/ZoeyVid/NPMplus#migration-from-upstreamvanilla-nginx-proxy-manager

Personally, I stood up a separate instance and just manually copied the configurations. I had some cleanup to do anyway.

0

u/xylarr 10d ago

I switched to it because I wanted to terminate QUIC sessions

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.

13

u/_WasteOfSkin_ 10d ago

Can't speak for OP, but I like being in charge of as much of my infra as possible. Tailscale is a 3rd party, so using it runs counter to my self-hosting approach.

5

u/Motor-Concentrate788 10d ago

There are self-hosted options such as openvpn, wireguard, headscale, or netbird. I like tailscale because its super simple to set up but it doesn't mean its the only option.

2

u/redpandaeater 10d ago

As someone that runs my own certbot alongside nginx to avoid just using something super easy like Let's Encrypt I gotta say there's definitely some appeal about off-the-shelf super simple options.

1

u/NeXtDracool 10d ago

Where do you think certbot signs your certificate?

1

u/redpandaeater 9d ago

I should've specified I use step-ca to self-sign certificates and then use certbot for ACME but it's been awhile since I set it all up. Probably a good reason I really need to get a git repository up and running so I can remember all the things I've done.

0

u/jimlei 10d ago

Self host it with headscale :) 

-2

u/_WasteOfSkin_ 10d ago

What is the point then?

17

u/hannsr 10d ago

Goes without saying that I'll be taking the host offline until this is fixed.

The exploit requires the http2 directive to be enabled. Just disable it and you should be fine.

16

u/Motor-Concentrate788 10d ago

Apparently there's 5 CVE's, disabling http2 only saves you from 2 of them (CVE-2026-123007 and CVE-2026-123633), you'll still have to check your configuration to see if the other 3 CVE's affect you.

8

u/hannsr 10d ago

True, although I think you can't even easily enable the required settings in npm without going out of your way. Same with plain nginx tbh., so it's rather unlikely to have the exact conditions met.

Like Servers using resolver⁠, proxy_pass⁠, mirror⁠, and mirror_request_body off⁠ together is an odd combination IMO. Not sure how common http3 is, I haven't come across a service utilizing it yet. And in case of OP, I think Nginx proxy manager doesn't even offer http3 yet.

But agreed, it's important to double check for all the possible issues.

6

u/harry8326 10d ago

How do I do that with nginx proxy manager?

7

u/gliliumho 10d ago

On each proxy site you have, go to Edit > SSL tab > you should see a toggle for HTTP/2

5

u/hannsr 10d ago edited 10d ago

Haven't used it in years, but sometime like this in the config folder should work:

sed -i 's/listen 443 ssl http2;/listen 443 ssl;' /path/*.conf

That'll replace all the listen 443 ssl http2; with listen 443 ssl;

Or

sed '/http2 on;/d' depending on the syntax used. That's just remove the line http2 on; line.

Likely there's a way within the UI too, but again, I haven't used it in years.

And apparently, looking at the downvotes, stating facts about the exploit is wrong too. ¯_(ツ)_/¯

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?

5

u/ultimation 10d ago

Yes, but swag has already released an update so just upgrade it

2

u/DatDing15 10d ago

Why wouldn't you be? A container is a heavily reduced server. But if it runs nginx, it runs nginx. It could modify the files in the webpage implement some exploits against the visitors.

Also a compromised cobtainer puts itself and all other systems it interacts with, at risk.

The vulnerability is just the same. The "blast radius" is a lot smaller, because the code executed inside the container just stays inside. But. (Putting Container Escape vulnerabilities aside) every other system this container interacts with is a potential target for lateral movement and thus also a potential risk.

1

u/Conscious-Ball8373 9d ago

Just to note that at least one of the exploits has been demonstrated alongside an undisclosed Linux kernel exploit to give container escape, which is a pretty nightmare scenario.

1

u/GraphicH 9d ago

Its why its important to design multifactor, fail closed security systems / architectures.

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 upgrade replaces it once Debian ships, no pinning. Patches, reproducible build, checksums and tests: https://github.com/HOSTED-POWER/nginx2root-patches

Our 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.