-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(detectors): Fix bug with empty string and keyword in SQL Injection Detector #93071
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
leeandher
left a 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.
Suggestion for customizing the detection, but since this is a prototype no need to block 👍 my philosophy was to just replace all hard-coded numbers/limits with settings when possible, but if this is unnecessary feel free to ignore
| not isinstance(query_value, str) | ||
| or not isinstance(query_key, str) | ||
| or not query_value | ||
| or len(query_value) == 1 |
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.
Is it worth having a minimum match? I could see false positives for queries like "es" as well. You could add it as a detector setting as well and then customers could tweak the detection
e.g.
len(query_value) < self.settings.get("minimum_match_length")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 think that makes sense , will do it in a diff PR!
adds a few additional checks to the sql injection detector: