-
Notifications
You must be signed in to change notification settings - Fork 293
Body Inspection for PUT Failing #125
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
Comments
Hi @guytp I think your problem is here:
I think this might be related with requests containing empty JSON data. Please go over issues owasp-modsecurity/ModSecurity#1392 and maybe owasp-modsecurity/ModSecurity#1879 to understand if it's related. Also, can you post the content of the body of the request so we can try to reproduce the issue you're facing? You may need to add section "C" of SecAuditLogParts to your configuration which might explain why you're not seeing the POST data on your logs. You may also want to check that SecRequestBodyAccess is "On" to ensure that the body is actually being inspected in the first place. |
This happens with a number of body-types. One of which is an authentication endpoint with the JSON content: {"Username":"xxx", "Password":"yyy"} There are some others but that is the simplest request type generating this. Confirmed these requests are not empty. These are all for ProxyPass directives. If in DetectionOnly mode the actual server that handles the API calls gets the full request with JSON and returns a valid response. This also happens with requests I manually fire off to the endpoint. SecRequestBodyAccess is definitely on - hence no problems with POST requests. Adding "C" to SecAuditLogParts makes no difference - have also tested this. No special characters from #1879 nor is the body empty from #1392. I can provide a full set of log files if required and additional logs if required. Let me know if there's anything else that can help with this. |
Hummm weird :/ Please share your modsecurity.conf, nginx.conf, audit_logs and debug_logs in a Gist for further investigation. You don't need to share all of the confs, just minimal reproducible configuration files that can help us on try reproducing the issue. Also, please share the full POST and PUT request that triggers the issue. Thanks. |
Closing the issue as we have no feedback from the user. |
Uh oh!
There was an error while loading. Please reload this page.
First attempt with ModSec / nginx so I apologise if this is my error. Seen references to this in 2.x but not 3.x.
I have ModSec 3.0 (v3/master) with nginx connection (master) and nginx 1.14.0 running rulset (v3.0/master).
If I have requests with a body using the PUT verb it appears that the body is not inspected and an error is generated. These requests with POST work fine. All PUT request seem affected.
The "-I" component of the log is empty and ""Failed to parse request body" errors are generated. Based on the Content-Length, the response from the server and the fact I've tested these requests manually suggests that the data is valid and being received by nginx/passed through - just that modsec seems to not notice it.
Any suggestions?
The text was updated successfully, but these errors were encountered: