Conversation

Replying to
Yeah, we use it for GrapheneOS. It's unfortunately not maintained anymore and bitrotted due to a major pyparsing update. It doesn't work anymore unless you force holding back the update. It'll be a bit annoying to use now that the main tainted input sources have strict checks.
1
It's unfortunate directives like return are still vulnerable. Most vulnerable configuration will be fixed by people updating to 1.21 / 1.22 but there will still be plenty of vulnerabilities. It's unfortunate they don't even mention those directives don't do escaping in docs.
1
Replying to
> It'll be a bit annoying to use now that the main tainted input sources have strict checks. What do you mean, how does that make Gixy more annoying to use? Do you mean that it would now have false positives due to better Nginx behavior?
2
> It's unfortunate they don't even mention those directives don't do escaping in docs. It's also unfortunate that things like "if in location is evil" are only mentioned on nginx.com, and not the main documentation on nginx.org.
1
Replying to
Their statements about the if directive are problematic because they should be telling people what's safe and what isn't separately from documenting best practices for performance / style. It's fine to use it if it only contains return/rewrite directive. Other stuff is broken.
2
Replying to
Their best course of action would probably be to outright refuse to load a configuration that uses the unsafe directives in that context, honestly. But who knows if they'd actually do that. :/
1
Replying to
There are a few examples of completely correct and sensible usage of if directives in github.com/GrapheneOS/gra and our other nginx configurations. #1 is safely removing double slashes in a single redirect which is important for SEO to avoid having multiple locations for content.
1
We use /foo/baz/ for a directory and /foo/baz/bar for a page with redirects from /foo/baz/index.html, /foo/baz/index, /foo/baz/bar.html, /foo/baz/bar/, etc. Current approach is very efficient and uses a mix of try_files and if to get exactly what we want very efficiently.
1
They make try_files seem far more awesome than it really is in their documentation. Even `try_files $uri.html =404` blocks the worker for a stat system call, and each entry is another stat system call. It usually doesn't block in practice since all directory nodes get cached.
1
Show replies