-
-
Notifications
You must be signed in to change notification settings - Fork 402
Rule 921110 #1883
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
Another realworld FP (editing WordPress CSS file):
|
Hi @azurit, could you help us with a |
@airween Using curl, i was able to reproduce it with HTML encoded EOL:
|
I've reviewed this rule and the issue. I'm wondering why is there the EOL characters at the end of used regex:
In the rule's comment I've found this: This rule looks for a HTTP / WEBDAV method name in combination with the word http/\d or a CR/LF character. But the given link I just found patterns only with string These characters came into regex with this commit - @fgsch could you help us to explain what's the reason that we use EOL at there? I'm not sure that the pattern without |
That is in case the request is using pre-HTTP/1.0 (e.g., GET /\r\n). Pattern: Input: What am I missing? |
@fgsch Is there any web server which supports pre-HTTP/1.0? |
ah, thanks.
DJ Wich - soundtrack Gympl %0D anything other here so previous line ends with EOL from the pattern: (?:get|post|head|options|connect|put|delete|trace|track|patch|propfind|propatch|mkcol|copy|move|lock|unlock)\s+[^\s]+(?:\s+http|[\r\n]) |
Here is the regex101 case with few remarks:
|
I was looking at the wrong version of the rule. Actually, commit 8f53825 removed the leading [\r\n]+ that should have prevented this. |
@azurit Def some versions of apache and I believe nginx. |
A possible solution:
Pattern and test cases are here. Any remarks are welcome. |
@airween, even with your update,
What do you think of this rule? It removes the HTTP/0.9 version check, but maybe that can be put into a separate rule that can be enabled if HTTP/0.9 is enabled.
|
Actually, I forgot about the
Does this look right? I also added HTTPS checks. - (?:get|post|head|options|connect|put|delete|trace|track|patch|propfind|propatch|mkcol|copy|move|lock|unlock)\s+(?:([\r\n]|\/\w|\/|http:\/\/))
+ (?:get|post|head|options|connect|put|delete|trace|track|patch|propfind|propatch|mkcol|copy|move|lock|unlock)\s+(?:(\/\w|\/|https?:\/\/))\S*\s+http\/ |
Hi @ssigwart, well, so many thanks for your update! I don't see where is the matched sub-pattern in your first example. The The second example is good, because the I think the modified rule isn't good - just see the regex101.com link above, and replace the regex by your. You will see that the matches of most subjects will gone. If you think that we should exclude the request with CT Or may be we should add some comment for the rule, how can user make the exception. |
similar result with the modified pattern: there are few regression test case which doesn't match. Just try the regex101 link. |
In the first example, that's because of the HTTP/0.9 check. I think I tried the regex101 link on the second one. The regressions are
I don't know enough about the vulnerability to make that call, but from my little knowledge, I think that would introduce an edge case that could be attacked. Does this vulnerability always require |
Your first example matches with this modification:
as you can see, I had must to add a new line after the
I don't want to break the original functionality of this rule. But may be we can't avoid that...
That's a good question. I mention @fgsch now, hope he can helps us :) |
For some reason, when using
It would be great if the
|
This drops pre-HTTP/1.0 support, partially reverting 80d2338. Should address coreruleset#1883.
This should now be resolved by #1966. Thanks for reporting and helping to flesh out the issue! |
Uh oh!
There was an error while loading. Please reload this page.
Audit Logs / Triggered Rule Numbers
FP can be easily triggered, for example, with this text in any POST field (realworld example from music forum):
On HTTP Request Smuggling webpage ( http://projects.webappsec.org/HTTP-Request-Smuggling ), example of exploitation is using two Content-Length headers. Is there any other way how to exploit this? If not, we should add something like this to the rule:
SecRule &REQUEST_HEADERS_NAMES:Content-Length "@ge 1"
EDIT: Seems explotation is possible also by other ways, see: https://www.cgisecurity.com/lib/HTTP-Request-Smuggling.pdf
Your Environment
Confirmation
[x] I have removed any personal data (email addresses, IP addresses,
passwords, domain names) from any logs posted.
The text was updated successfully, but these errors were encountered: