-
-
Notifications
You must be signed in to change notification settings - Fork 709
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
ascanrules: Refactor sqli scan rule into helper functions #5868
ascanrules: Refactor sqli scan rule into helper functions #5868
Conversation
64175c9
to
e79c129
Compare
Fix merged commit and rebased with main. This is just copy/pasting the different types of sql injection logic into helper functions. Unfortunately, the git diff doesn't seem to pick it up the changes as cleanly as it could and it looks messier than it is. Not sure what's up with that. |
Needs to ignore whitespace changes: https://github.com/zaproxy/zap-extensions/pull/5868/files?diff=unified&w=1 |
prefixStrings = new String[] {"", origParamValue}; | ||
} else { | ||
prefixStrings = new String[] {""}; | ||
testErrorBasedSqlInjection(param, origParamValue); |
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 this is changing the behaviour, the returns that would return from the scan method are now just returning from the extracted methods (and flow continues here), I didn't check the whole code yet but at least it should have isStop checks between them.
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.
Good catch. Updated to skip remaining cases if either isStop()
of sqlInjectionFoundForUrl
Signed-off-by: FiveOFive <[email protected]>
e79c129
to
537248e
Compare
Thank you! |
🎉 |
Overview
Cleaning up sql injection scan rule code ahead of making updates for false positives in zaproxy/zaproxy#8652. This change is just to split the different types of sql injection tests into helper functions. No logic changes. This makes it easier to tell what types of sql injection tests the rule is running and to find the code for each one.
May want to merge these other PRs with unit tests first:
Related Issues
Checklist
./gradlew spotlessApply
for code formatting