-
Notifications
You must be signed in to change notification settings - Fork 1.7k
v2: Allow partial processing of XML, JSON, and multipart request body #3483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v2/master
Are you sure you want to change the base?
v2: Allow partial processing of XML, JSON, and multipart request body #3483
Conversation
…ssing" Due to the previous change, the "no final boundary missing" error never occurs when SecRequestBodyLimitAction is ProcessPartial.
Adjust the expected error message to match the message changes introdueced in: owasp-modsecurity@dfbde55
But reject incomplete epilogue when body fits in limit.
|
Hi @hnakamur, thanks for this PR too.
I think and the payload: then the @dune73 what do you think?
How can we be sure that the payload is valid, if the error is in the chunked part? Eg. consider the config above and this JSON: {"a":1,"b":2,[1]]}(the second You helped me in #3456, which isn't merged yet (I'm waiting for a review and an approve). But could you add a new test case to the v2's source tree? |
|
Hello @airween. Thanks for your comment. I added tests for url-encoded, JSON, and XML request bodies. It appears that the URL-encoded parser already works as expected with By the way, I realized that it would be better to add more tests for multipart requests. I think it will take me a day or two to do so. |
This check is added to satisfy SonarQube Cloud Quality Gate on CI. owasp-modsecurity#3483 (comment)
To satisfy Quality Gate in CI. owasp-modsecurity#3483 (comment)
To satisfy Quality Gate in CI. owasp-modsecurity#3483 (comment)
5b38984 to
0bfb828
Compare
|
I was mistaken about that. I modified the URL-encoded parser to include names and values up to the delimiter before the limit when SecRequestBodyLimitAction is set to ProcessPartial and the request body exceeds SecRequestBodyLimit. I also modified the multipart parser to include parts whose boundary appears before the limit under the same conditions. In addition, I added tests to cover these changes. |




what
SecRequestBodyLimitActionis set toProcessPartialand the length of an XML or JSON request body exceeds the configured limit.why
SecRequestBodyLimitActionisProcessPartial, the expected behavior is to process the partial XML, JSON, or multipart body up to the defined limit.references
The same modification for v3 is at: #3476