-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ModSecurity strips POST data information from request in DetectionOnly mode #538
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
Original reporter: rhuiser |
bpinto: This is a known issue. Looks like some modules other than ASP.NET have problem forward request body with ModSecurity. Right now you cannot enable request body in this cases. Setting SecRequestBodyAccess Off will make it work Thanks Breno |
rhuiser: Thank you Breno for your swift answer! Do you know when or which release of ModSecurity this issue will be solved since switching off the option will no longer protect us from XSS or SQL injection (amongst others)? |
bpinto: Hello Robin, We are discussing it with Microsoft. This is an issue based on IIS arch. Right now we don't have an ETA for this issue. However we agree this should be fixed as soon as possible. Turning off SecRequestBodyAccess means modsecurity will not protect attacks coming into request body. So basically modsecurity will inspect request headers. If SQL attacks are going into requests headers, modsecurity will still protect. Thanks Breno |
rhuiser: Hi Breno, We tried to work around the issue by splitting the virtual hosts in IIS; VHOST 1 with ModSecurity including Application Request Routing module of Microsoft to act as a reverse proxy by forwarding all (scanned) traffic to VHOST 2 which has ModJK deployed: VHOST 1ModSecurity Unfortunately, when switching "SecRequestBodyAccess" to "On", traffic is no longer forwarded (time out). Another setup we tried is to remove ModJK from the equation and have ARR forwarding all traffic to JBoss directly: VHOST 1ModSecurity Unfortunately, when switching "SecRequestBodyAccess" to "On", POST body is empty again. Could you confirm from the architecture issues you are facing with ModSecurity / IIS / SecRequestBodyAccess the ARR module is also not usable in the setups shown above or is this a different issue? Thanks in advance, |
bpinto: Hello Robin, Yes. Looks like the issue we are already working on. Thanks Breno |
ianw: I am seeing the exact same symptoms on CentOS 6.4 + nginx 1.5.1 + ModSecurity 2.7.4 - does the same architecture issue exist for the nginx port? Thanks, |
bpinto: Could you please describe in details your environment and nginx + modsecurity configuration ? I would like to try reproduce. Also if you can send details about the POST you are trying to send. Thanks |
ianw: The environment is a CentOS 6.4 installation; nginx has the following -V output: nginx version: nginx/1.5.1 ModSecurity is built from the 2.7.4 release tarball, with the following options: I can reproduce the problem with the modsecurity.conf-recommended from the 2.7.4 tarball and the Core Rules 2.27. Any POST request can cause the issue. Here is a simple form that will trigger it, when combined with the below configuration: First name:I can reproduce with the following abbreviated configuration, which sends all requests upstream to the requestb.in service: upstream requestbin { server {
} |
ianw: Retested with ModSecurity 2.7.5 RC tarball; error is still present. Is there any other status update on this? |
bpinto: Ian, I didn't test with your module options. Just with default nginx modules + modsecurity and a similar configuration:
Then submit a POST to 192.168.0.103/backend/index.html and all looks fine from my side. I will need more time to try reproduce your issue. Thanks Breno |
ianw: I assume you mean submit the POST to localhost/backend/index.html? If submitted to 192.168.0.103/backend/index.html that bypasses the Nginx server entirely. The critical setting is in my modsecurity.conf: If this is set to "Off" my installation works fine; with it "On" all POSTs are truncated during the forward to the backend server. Thanks, |
bpinto: Yes. Sorry for the typo. Sending it to localhost (nginx server) SecRequestBodyAccess is also On from my side. Could you attach your debug.log (level 9) with the malformed POST ? Thanks |
ianw: My apologies for taking so long to get back to this. I've attached a level 9 debug log from ModSecurity for the failed request and also an Nginx debug log for the same request. |
I am also seeing this on nginx + mod_security , logins to common applications (eg wordpress) are broken, super easy to reproduce enable requestbody access, and then try logging into a default wordpress (this is nginx 1.4.1 and trunk mod_security ) . |
Any update on this? Did the file attachments transfer over, or do I need to reattach the debug logs? |
Related to nginx and posts, there are two bugs that may affect the behavior of applications such Wordpress, they are: #154 and #142. The first one was about the inability to set more than one cookie in certain circumstances (applicable only to the nginx port). As reported in the bug it was fixed and available under the development tree. The second just happens with large POSTs and it was not fixed yet, more detail available at #142. |
Hi, I'm wondering if this issue is still being looked at? I downloaded the latest version of Modsec 2.7.7, and installed on iis 8.0. I then setup an ARR proxy. The symptoms above is still happening, so post requests timeout, but all get requests work perfectly ok. Switching off the SecRequestBodyAccess means it now works, as described above, however as previously noted, I'm now concerned that I've switched off quite a major bit of functionality, and since this proxy I'm building will handle data for a payments solution, my worry is now that my proxy will not be as robust as it needs to be.. |
Hi, We are suffering an issue related to POST inspection, although not same impact as those described above. |
if you put this line into modesc.conf: SecStreamInBodyInspection On it appears to resolve the issue. Putting this line in my config solved the issues I was having, although I'm unsure if modsec has now been compromised in some way.. |
indeed something that I missed. |
no problem.. hope this solves your issue.. |
It doesn't :-( |
What do you mean with "although I'm unsure if modsec has now been compromised in some way."? |
well I just mean that this rule fixes my issue, however I don't have a full understanding of how or why.. It could be that its turning something off. Previous to that, I turned SecRequestBodyAccess Off as suggested above, however as this does compromise modsec I looked for an alternative fix hence the suggestion I made above. |
Thanks. |
well, I'm going to open a new case. |
SecStreamInBodyInspection On worked on IIS7.5 ARR2.5 |
We are using Microsoft Dynamics NAV 2016 Web Client but POST parameters won't forward correctly when SecRequestBodyAccess is set as On. Adding SecStreamInBodyInspection On to config file works on IIS8.5. |
SecStreamInBodyInspection On to config file works on IIS8.5, Server 201212 R2 (in Azure) Also I checked that POSTed variables were still checked : they are J |
SecStreamInBodyInspection should be turned on for IIS. As for Nginx, support for this module in ModSecurity 2.9.x branch is deprecated. This shouldn't be a concern with libModSecurity. Thanks! |
MODSEC-390: For a Dutch bank we purchased the commercial ruleset from TrustWave labs. In the process of setting-up the ModSecurity in combination with IIS we hit an issue which we cannot solve and basically renders the ModSecurity module unusable for our environment.
When enabling ModSecurity for the default virtual host, POST parameters are no longer passed to the JBoss application server via the mod_jk plugin.
We deployed on this virtual host the mod_jk ISAPI module which works as expected when ModSecurity is disabled.
After enabling ModSecurity (DetectionOnly mode), access to the the login-page via Java ServerFaces works fine (and access to all other dynamic content which does not require POST information to be sent) until we try to submit for instance the username.
The submitted username is received by IIS (confirmed this through our Web Debugging Proxy (Charles)), but the POST parameter data itself is empty when received by our application (confirmed by the log files produced by the application).
In the Windows EventLog Application log there are no ModSecurity errors, only warnings concerning rules have been hit.
We installed ModSecurity using the MSI installer on IIS.
Installation seems successful, we see the in Windows EventLogger the ModSecurity Information logs:
ModSecurity for IIS (STABLE)/2.7.3 (http://www.modsecurity.org/) configured.
ModSecurity: APR compiled version="1.4.6"; loaded version="1.4.6"
ModSecurity: PCRE compiled version="8.30 "; loaded version="8.30 2012-02-04"
ModSecurity: LUA compiled version="Lua 5.1"
ModSecurity: LIBXML compiled version="2.7.7"
Please advice,
All the best,
Robin Huiser
The text was updated successfully, but these errors were encountered: