Skip to content

Conversation

@jleproust
Copy link
Contributor

A relatively small json payload (<1MB) can generate up to a hundred thousands keys and values, which can then take ages (>30 minutes) to process with OWASP's CRS 3 for example. The parser is not the issue, no particular rule is the issue, it's just the pure quantity of values.

Obviously, with the nginx connector, this completely locks the worker for the whole duration, so it is a DoS vulnerability.

This is the underlying issue behind #2019 and I guess, owasp-modsecurity/ModSecurity-nginx#89 too.

That's why I implemented a SecArgumentsLimit value, disabled by default, allowing to set a limit to the number of extracted arguments. When the limit is reached, subsequent values are ignored. A limit of 1000 arguments should be enough for most applications, and reduces the maximum processing time to well under a second. Requests with more than 1000 arguments can be matched and rejected if wanted with a rule like SecRule &ARGS "@gt 1000".

In addition, I made the JSON processor cancel the parsing when the limit is reached.

@victorhora victorhora self-assigned this Apr 12, 2019
@victorhora victorhora added 3.x Related to ModSecurity version 3.x enhancement new feature This is a new feature pr available labels Apr 12, 2019
@zimmerle zimmerle self-requested a review June 18, 2019 18:32
@zimmerle zimmerle added this to the v3.0.4 milestone Jun 18, 2019
@feromax
Copy link

feromax commented Jul 10, 2019

Hi there. Anyone have an ETA on when this will be merged? Thank you :)

@zimmerle
Copy link
Contributor

Closing this in favor of #2234.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Related to ModSecurity version 3.x enhancement new feature This is a new feature pr available

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants