Repository navigation
FEAT: Expand XSSOutputScorer to detect SVG and JavaScript data URIs - #3400
Open
Vardhman Gupta (Kaap10) wants to merge 1 commit into
Open
Vardhman Gupta (Kaap10) wants to merge 1 commit into
Vardhman Gupta (Kaap10) wants to merge 1 commit into
Conversation
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.
Description
Closes #3399
Expands data URI detection in
XSSOutputScorerbeyondtext/htmlto cover executable and scriptable MIME types:image/svg+xml): Detects SVG data URIs carrying executable markup across HTML tags (<img src="...">,<object data="...">,<embed src="...">), markdown image syntax (), and raw payloads.text/javascript,application/javascript,application/x-javascript,text/ecmascript): Detects script-bearing data URIs across<script src="...">, markdown links, form actions (action,formaction), and bare URIs.(?![A-Za-z0-9+_-])to avoid false positives on non-standard/unrelated MIME subtypes (e.g.data:image/svg+xml-fake).Tests and Documentation
test_xss_executable_data_uris_detectedcovering 13 test cases across raw SVG, Base64 SVG, markdown image syntax, object data,<script src=...>, JavaScript MIME variants, markdown links, and form actions.test_xss_not_detectedwith negative controls for benign data URIs (PNG, JPEG, JSON, text/plain, audio/mp3, and fake extensions)."Data URI with Executable Content"and"Bare Data URI with Executable Content".