If I understand correctly, this is a vulnerability in self-hosted Bitwarden only. Is that correct?
Hunting for Nginx alias traversals in the wild
91–100 of 165 posts
Re: Hunting for Nginx alias traversals in the wild
#92Re: Hunting for Nginx alias traversals in the wild
#93Please excuse the silly question: Would proper directory and file ownerships not prevent this traversal? If nginx does not run as root, how can it read other files than the ones explicitly assigned to the nginx user?
Typical umask is 022 so most things are readable by nginx workers but not writable, they don’t need to be explicitly assigned (e.g. to www-data). If your application generates sensitive data of course you should probably use a 077 umask.
Re: Hunting for Nginx alias traversals in the wild
#94How is this not seen as a vulnerability in nginx? This behavior is utterly absurd, seems to have no beneficial purpose, and straightforwardly exploitable.
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.
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: Hunting for Nginx alias traversals in the wild
#95If all you need is a simple way to serve static files that minimizes resource consumption and is reliably secure, what is the state of the art these days? In the past I would probably reach for Nginx, but I wonder if a more focused/less configurable tool would be preferable from a security standpoint.
how is a static site served from S3 considered in these parts of the interweb? i've never done this, but see it as an option, yet i never really hear others using it either.
I've run a couple of websites (WordPress or Hugo based, including my personal blog) like that and it's great.
Re: Hunting for Nginx alias traversals in the wild
#96If all you need is a simple way to serve static files that minimizes resource consumption and is reliably secure, what is the state of the art these days? In the past I would probably reach for Nginx, but I wonder if a more focused/less configurable tool would be preferable from a security standpoint.
how is a static site served from S3 considered in these parts of the interweb? i've never done this, but see it as an option, yet i never really hear others using it either.
I personally prefer something like Github Pages, though - it doesn't get much more hands-off than that!
Re: Hunting for Nginx alias traversals in the wild
#97Earlier quoted context omitted.
Last release 2016??
OP wanted a simple web server for serving static content. Are you aware of open CVEs? No? It's possible for software to be done you know. Just because something isn't a rolling release of change for the sake of change (like most Google crapware) doesn't mean it isn't fit for purpose.
And a C program, written by a single developer, with only 27 issues ever being filed? With all due respect, that's guaranteed to have some nasty bugs in there.
Re: Hunting for Nginx alias traversals in the wild
#98Earlier quoted context omitted.
no it wouldn't work if the user nginx is running as didn't have read access to the directory or files
Ah then I just realized, it probably does have access to all nginx log directories, because nginx needs write permissions to them anyway, right? Now I really want to go double check all my permission setups...
Or just write to stdout and have systemd handle the logging for you, that'd work too.
Re: Hunting for Nginx alias traversals in the wild
#99If all you need is a simple way to serve static files that minimizes resource consumption and is reliably secure, what is the state of the art these days? In the past I would probably reach for Nginx, but I wonder if a more focused/less configurable tool would be preferable from a security standpoint.
Shameless plug: Caddy does a great job here. Automatic HTTPS, written in Go so memory safety bugs are not a concern, has a solid file_server module.
Re: Hunting for Nginx alias traversals in the wild
#100OK hear me out: a Linux capability like option that removes the .. option from the kernels file name parser. Like web apps have been seen various bypasses involving somehow smuggling two dots somewhere since we were on dial up modems. It's time to look for a way to close this once and for all, as the Linux kernel has done with several other classes of user land bugs.
If you are serving files to web from the folder, the web framework should handle not taversing the public root folder it was tasked to serve. If are rolling your own, well now you have to consider all kinds of stuff, including this.