-
Notifications
You must be signed in to change notification settings - Fork 292
modsecurity + auth_request hang #163
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
@defanator Hi, I see you fixed this issue #131. But with my latest test, seems it doesn't work. In your testcase, I see you use http/2, right? |
@chaoyun in connector tests we are using both HTTP/1 and HTTP/2 where applicable. I believe there were some TODO-marked tests specifically for HTTP/2, and auth_request can be one of those. I need to refresh my memory about that topic. |
@defanator Thanks for the reply. Waiting for your update. I checked the log in the modSecurity, seems it parsed the request, and there's no further log in both modSecurity and nginx. I don't know where it hung. |
Is this still an issue? |
@zimmerle last time I checked there was an issue with HTTP/2. I'll try to pick some time to refresh this one. |
Thank you @defanator. Warming up a release. Checking on what could be closed. |
@defanator @zimmerle just got bit by this one too. Specifically kibana is completely broken with modsecurity + oauth proxy, which is a common combination people use |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
/reopen |
The "nostale" tag has been set for this one and it's now reopened. We'll get to it when possible. Thank you. |
see also: definitive workaround: At this point, we can write a unit test that sets conditions: (1) "POST + non-empty body", (2) side-car sub request Auth, (3) modsecurity enabled, (4) force HTTP2 + TLS session. iterate until the unit test works. I imagine that since modsecurity is inspecting the request body, even when modsecurity |
@victorhora @zimmerle with the information above, this should be relatively easy to track down |
this code looks really suspicious, and there are no unit tests configured with http2.
and
the most important thing is that no internal NGINX state should be changed as a result of modsecurity reading the request body. It is possible that Nginx should be giving modules a copy of the request buffers rather than the original request buffers, however, this module should have some sanity checking that "Nginx_state_before_processing==nginx_state_after_processing" |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
This is still an issue. The nostale label does not seem to work... /reopen |
I noticed that in I removed the TODO and after running the tests with different versions of nginx I found out that the tests are failing with the stable release 1.18.0 but are passing with mainline nginx 1.19.6 |
I just finished bisecting the nginx repository to find the exact commit that made the tests pass and this is it: nginx/nginx@6c89d75 I am not sure if a workaround is possible. |
@mtorromeo thanks for digging into this! I have marked those tests as TODO and was going to specify the exact version where the issue has been resolved. Hopefully to find some time this week for that. |
I was hoping to find an easy fix and it's a bit disappointing to find out that it's actually a bug of nginx itself and that such a critical issue was not even backported to stable but what can you do... |
See the following issue for details: #163
@mtorromeo adjusted TODO versioning here: 3f016fc (there's another couple of passing TODOs related to alerts in error log; I'll handle those separately) |
hi, Experts:
I meet some issue why enable modSecurity plus with auth_request + http/2.
If a request with POST data, it will hang there. But "GET" method works well.
There's a similar issue discussed in the kubernetes/ingress-nginx#1932
Disable modSecurity, it can work. Disable auth_request, it can also work. Using http1.1 can work too. Only the combination of "modSecurity"+"auth_request"+http1.1 cannot work.
Do you have any test for this case?
The text was updated successfully, but these errors were encountered: