-
-
Notifications
You must be signed in to change notification settings - Fork 402
False Positive 932100 (Unix command injection) for OData-queries #2123
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
@edwinvandeburgt Thanks for the report, we are going to review it soon! |
For the sake of documentation for other devs, OData comes from https://www.odata.org/ |
@edwinvandeburgt Can you add CRS version and other relevant information here (web server, modsec version, etc.)? |
This is a query submitted as a query string. Correct? If yes, is this really a false positive or rather a architecture weakness that was used for benign purposes in this particular situation? |
Well, it is probably a false positive. We include the expand unix command in our list, and that is being catched. |
Yes, sure. The rule is not aimed at odata. But - with a bit of distance - if some kind of software would send SQL queries in query strings, we would consider it a legitimate alert, would not we? That does not rule out the option to create a odata rule exclusion package - volunteers welcome - yet I think it would be wrong to tune down the unix command rules because it odata happens to use some of the keywords in its query language. Even more so as evasion is a huge problem with the unix commands where the bash shell will execute just about anything thrown at it. Or am I overly strict in this regard? |
Here are some more details. We are running a WAF op Microsoft Azure Application Gateway: ruleSetType_s | OWASP_CRS @dune73 , @fzipi I can follow both your reasoning and while it might be a good check, I read on the OWASP FAQ that with PL1 you should face False Positives rarely. For any more advanced OData query, this is going to fail a lot, not rarely. So maybe this particular check should/could/might be moved to a (new) PL2+ rule. Also, I posted another message ago about some other PL1 rule that fails... That one was about a FetchXML query string... While I understand the reasoning for SQL-injection attack mitigation, as the world is moving to other means of performing queries like OData, it would be nice if the CRS could differentiate a bit better between OData, FetchXML, SQL etc. and check rules appropriately :-) I'm not volunteering :-), because this particular 932100 rule has such a complex RegEx, I can't make anything of it ;-) Btw, I do run the RegExes (from the CRS source) against the query string to check while it fails, although the logging is also pretty clear about it... For any more questions, let me know ;-) |
Amazing, that's a lot of information that helps us identifying the problems. The good thing is that the regexp is generated based on this source file. So that you can check. The problem is clear there. |
You can read the comments on the rule itself.
|
I see :-) I should have read the sources. Nicely documented by the way! |
Thank you. Much appreciated. |
Thanks all for your comments. The action that will be taken from this one is then:
Closing this one. |
Rule 932100 is triggered for OData queries that contain an $expand keyword.
URL-fragment (table and column names replaced):
.../table?$select=a,b,c,&$expand=c($select=d,e,f;$expand=g($select=h),i($select=j)),k($select=l,m)&$filter=n/o%20eq%20'10091595'%20and%20p/q%20eq%200%20and%20r/s%20eq%200%20and%20t%20eq%200
Both the "&$expand" and ";$expand" are matched by the 932100 regex.
The text was updated successfully, but these errors were encountered: