-
-
Notifications
You must be signed in to change notification settings - Fork 402
Fix false positives with rule 942360 #1817
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
Conversation
Any idea what's up with the CI? |
Why we want to not trigger this rule by sending |
It was part of a patterns of false positives and I went too quickly over it, thanks for catching it, I'm removing it and going over the other exemples to make sure I haven't missed anything. |
@Taiki-San This is what I'm seeing in the logs:
|
Weird. The line doesn't match.... I'm having a second look at it.... |
Ok, don't look for a problem yet. I'm testing again but surely will need more time for it. |
No problem, thanks for spending the time! |
Émil-Hugo and I will work on this PR in the next month, with the goal to merge it on the next meeting. Note to self from the Slack chat: for instance, one might send: "truncate |
My suggestion is to replace the |
Hi guys, chat is up tonight. Any progress here? |
Ping |
Monthly chat meeting September: @franbuehler volounteers to help here. |
Ran a few tests on the rule with a wide variety of production trafic, it's now much less sensitive to free text blob, while still catching many malicious queries. |
Hey @Taiki-San. Thank you for your work on this issue. This has been lingering much too long. Am I getting you right, that we have less FPs now with the updated pattern, but we also miss a few attacks? So we traded false positives for false negatives? (This is not necessarily bad, I just want to be sure we have it black on white). Also would you mind rebasing this to v3.4 (And sorry taking so long for the review). |
3adcdf6
to
051dcb0
Compare
Hey @dune73, no problem, hadn't had much time to push it harder. I think you got it. I suspect if we end up deciding that those triggers were worthy, a forked rule could be introduced in >= PL2 |
I think what we would be doing in this case would be to push the existing 942360 to PL2 as 942361 (stricter sibling) and take your updated version as the new 942360. Could you draw up a brief list of the patterns your version still detects and which ones it does not? |
Sounds great! |
Thank you for your support. But I would prefer to talk about the patterns here first. In order to get an overview before you spring to action with all the splitting work. |
Sure, here are a few samples:
Triggers we no longer detect:
|
051dcb0
to
cf0bdfa
Compare
Renumbered the original rule to 942362 (942361 was already taken)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks good to me from what I can understand.
I regenerated the regexes and ran the tests (I know CI runs them too :) ).
I found one small error with the PL tag, see below. And asked one question. See below.
I see and understand @Taiki-San explanations what we are introducing with this change. Less FP, but also possibly more false negatives at PL1...
I cannot fully assess the consequences because I'm not an SQLi pro. But as far as I can tell, this PR is clean work and looks good to me.
^[\W\d]+\s*?select\b | ||
^[\W\d]+\s*?truncate\b | ||
^[\W\d]+\s*?update\b | ||
^[\W\d]+\s*?alter\s*aggregate\b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we duplicate these regexes from here downwards, I mean these alter...
, into the rule 942362?
And also line 32 (load_file
), line 33 (regexp
) and line 35 (create
) while they don't change.
Don't we just want to duplicate the regexes into 942362 that get stricter?
Just asking, I'm not sure...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong preferences here, I just kept the old 942360 as is in order to keep the review simple(r).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Personally, I wouldn't duplicate them. But also no strong preferences here. Other opinions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original suggestion to duplicate the old rule came from @dune73:
#1817 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially I thought this would play out better with strict siblings, but in fact it does not really bring any advantages here. On top the lower PL rule is executed anyway. So I think it can be skipped.
But maybe we can have @lifeforms opinion as well. I would like to make sure we get this right.
Sorry, but I overlooked your PR in December. So this PR should not have had the label "needs work" anymore and it ought to have been discussed on Jan 4. Given reviewer @franbuehler deemed it ready for merging when said PL fix is done, I think we can merge this one. Thank you for your welcome contribution @Taiki-San. |
Address issue #1816.
This PR focus on two changes: