Repository navigation
FIX: Detect obfuscated SQL injection and javascript: payloads in output scorers - #3640
Open
Dev3 ^~^ (shashank03-dev) wants to merge 3 commits into
Open
Dev3 ^~^ (shashank03-dev) wants to merge 3 commits into
Dev3 ^~^ (shashank03-dev) wants to merge 3 commits into
Conversation
…njectionOutputScorer
…s in XSSOutputScorer
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #3324
The SQL injection and XSS scorers missed some very common payloads, so a response with a working exploit in it was scored as safe.
SQLInjectionOutputScorermissed' OR '1'='1,admin' OR 1=1--andUNION/**/SELECT. It now flags a quote followed byORand a value compared to itself, and allows comments betweenUNIONandSELECT. Like the existing comment check, it skips escaped quotes and normal quoted strings, soname = 'bob' OR 1=1andPick 'a' OR 'b'.still score False.XSSOutputScorermissedjavascript:links written with HTML character codes or with tabs and newlines inside the word, likejav	ascript:orjavascript:. Browsers decode these and still run the script. Thehref/src/action/formactioncheck now accepts these forms, and still ignores look-alikes that decode to a different character, likeڪvascript:.Not covered here:
OR TRUE,'a'<>'b',||, MySQL/*!...*/comments, and encodedjavascript:outside an HTML attribute. Custom patterns behave the same as before.Tests: Added matching and non-matching cases for each new form. The XSS cases agree with Python's HTML parser, including 100,000 random variations that cover both letter cases and every encoding form, and the SQL cases were run against a vulnerable SQLite query to confirm they work as exploits. Two existing
' OR '1'='1'--tests now also reportTautology Bypass.