News for hackers. Stuff that matters.
Re:Leaking Bitwarden's Vault with a Nginx vulnerability by phendrenad2 on Monday July 03, 2023 @10:13PM (#36581362)
It's done for speed. Straightforward text replacement is so much faster than checking to see if a path is properly terminated by a slash. And remember that Nginx became popular due to benchmarks that showed that it was more "web scale" than Apache2.
Re:Leaking Bitwarden's Vault with a Nginx vulnerability by amluto on Monday July 03, 2023 @11:07PM (#36581698)
I find it hard to believe that searching for “..” would even show up in a benchmark.

In any case, it seems that nginx does try to search for .. but has a bug in the corner case where the “location” doesn’t end with a slash. I assume there’s some kind of URL normalization pass that happens before the routing pass, and if the route matches part of a path component, nothing catches the ..

If I’m right, this is just an IMO rather embarrassing bug and should he fixed.

Re:Leaking Bitwarden's Vault with a Nginx vulnerability by D13Fd on Monday July 03, 2023 @11:16PM (#36581754)
Yeah, this whole thing reads to me like a bug in nginx. There is no obvious reason users would need that functionality.
Re:Leaking Bitwarden's Vault with a Nginx vulnerability by m3affan on Tuesday July 04, 2023 @12:10AM (#36582139)
What are the alternarives though?
Re:Leaking Bitwarden's Vault with a Nginx vulnerability by seanw444 on Tuesday July 04, 2023 @01:07AM (#36582444)
To Nginx? HAProxy. Or Caddy if you're just doing web stuff.
Re:Leaking Bitwarden's Vault with a Nginx vulnerability by terom on Tuesday July 04, 2023 @05:17AM (#36584147)
HAProxy does not serve static files, so it's a poor alternative for this specific case.
Re:Leaking Bitwarden's Vault with a Nginx vulnerability by sofixa on Tuesday July 04, 2023 @02:32AM (#36582972)
> And remember that Nginx became popular due to benchmarks that showed that it was more "web scale" than Apache2.

More like because it was much faster out of the box, and came with many batteries included while Apache2 required mods to be separately install.

Re:Leaking Bitwarden's Vault with a Nginx vulnerability by robertlagrant on Tuesday July 04, 2023 @04:42AM (#36583916)
And the config was nicer to read and write.
Re:Leaking Bitwarden's Vault with a Nginx vulnerability by okeuro49 on Tuesday July 04, 2023 @07:29AM (#36585237)
Your comment makes nginx sound like some fly-by-night server that only achieved its performance by making lots of tiny-yet-dangerous "optimisations" like this one.

More likely it is an omission, which could be rectified with a warning or failure running nginx -t (verify configuration).

The actual performance comes from an architectural choice between event vs process based servers, as detailed in the C10k problem article. [1]

[1] http://www.kegel.com/c10k.html

Re:Leaking Bitwarden's Vault with a Nginx vulnerability by phendrenad2 on Tuesday July 04, 2023 @01:44PM (#36590075)
False, the actual performance comes from architectural differences and optimizations.
Re:Leaking Bitwarden's Vault with a Nginx vulnerability by hedora on Tuesday July 04, 2023 @12:54PM (#36589291)
They could simply normalize the paths when parsing the configuration file. The overhead wouldn’t show up in benchmark because it only happens once at startup (and maybe when the conf file changes)