Conversation
Also introduce Map and Geo directives Also fix up two examples in plugins
| elif directive.name == 'rewrite': | ||
| # rewrite ^/1(/.*) $1 break; | ||
| regex_patterns.add(directive.pattern) | ||
| elif isinstance(directive, MapBlock): |
There was a problem hiding this comment.
This incorrectly checks every type of map{}, regardless of whether it's `location', 'server_name', 'proxy_redirect', 'if', 'rewrite'. This is kind of deliberate, but I wonder if it can be handled better, i.e. if it could be possible to resolve the variable, determine that it resolves to a Mapblock, and then loop over the Mapblock's children..
|
|
Closing this draft PR. While expanding ReDoS checks to more directive types is a valid goal, this implementation has some issues:
The existing
Thanks for the work on this! |



This PR adds more checks for ReDoS locations.
It also introduces a primitive MapDirective and GeoDirective, which can be used later to fully support Map/Geo (looks like that's going to be incredibly difficult, if not impossible, though).