-
Notifications
You must be signed in to change notification settings - Fork 728
Bypass the latest CRS v3.1.0 rules of SQL injection #1181
Comments
Summary
that checks for ticks and backticks with severity CRITICAL at PL2 as an addition to e WARNING rule 942110 at PL2. Details If I understand this issue correct, we have three problems, three evasion techniques, that can lead to SQLi detection bypasses (if I do not understand it correctly, please correct me, @qazbnm456):
Number 1 Triggers 5 rules (no rule at PL1): Individual paranoia level scores: 0, 3, 8, 8 Number 2 Triggers 3 rules (no rule at PL1): Test 2.2 Number 3 Individual paranoia level scores: 0, 3, 11, 8 Test 3.2 Individual paranoia level scores: 0, 0, 11, 8 We have at least a rule at PL2 (942110) that triggers, except for the last request/test 3.2 ( Rule 942110 at PL2 detects ticks and backticks: String The rule 942110 at PL2 has only severity WARNING. Maybe this is because of possible FP with only one What I would suggest:
Minimal string that triggers that rule is: I am not sure, if my proposed new rule is really better that the existing rule 942110. The testcase 2.2 What do you think of it? |
That sounds like a well thought through proposal. I think you should do this! |
Is this addressed by the above PR? |
@franbuehler is out for a couple of days. I asked her to return to this once she is back. |
Type of Issue
False Negative
Description
Per #1167, I wanna raise more FNs in this thread.
Before getting into other FNs, I want to give out more information to #1167 so as to help the maintainers fix the issue quickly. There're two problems lead to those SQLi bypasses, and those evasions would only work with
MySQL
.One is the lack of detections for legacy syntaxes, such as the ODBC escape syntax, which is accepted for ODBC compatibility (Ref: https://dev.mysql.com/doc/refman/5.5/en/expressions.html); the other one is the insufficient protection of libinjection due to the parsing process inside ticks. Return
TYPE_FUNCTION
when it encounters one of keywords of function names. You can clearly see the difference while parsing the following two quries. Because1&{f1
doesn't in the fingerprint database, it has been flaged as a benign query.Apart from that, I present additional SQLi bypasses in this issue here, and some of them also play with the same trick mentioned above together. Say, we have a code snippet that looks like this:
a'+(SELECT 1)+'
-1' AND 2<@ UNION/*!SELECT*/1, version()'
-1'<@=1 OR {a 1}=1 OR '
-1'<@=1 OR {x (select 1)}='1
a'+(SELECT 1)+'
These evasions work well with MySQL but may fail with other DBMS. I do the trick with the help of the
<@
symbol because libinjection doesn't handle it well, especially with MySQL, and therefore,<@
can be used to bypass the detection of libinjection (Ref: https://github.com/client9/libinjection/blob/master/src/libinjection_sqli_data.h#L8681). Because1&1o
doesn't in the fingerprint database as well, it has been flaged as a benign query.Some screenshots (The vulnerable web application is DVWA):
Your Environment
The text was updated successfully, but these errors were encountered: