dangerous xss unsanitized input#127
Closed
Abhigyan2005 wants to merge 3 commits intoDeepSourceCorp:masterfrom
Abhigyan2005:add-xss-unsanitized-input-rule
Closed
dangerous xss unsanitized input#127Abhigyan2005 wants to merge 3 commits intoDeepSourceCorp:masterfrom Abhigyan2005:add-xss-unsanitized-input-rule
Abhigyan2005 wants to merge 3 commits intoDeepSourceCorp:masterfrom
Abhigyan2005:add-xss-unsanitized-input-rule
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
sanket-deepsource
requested changes
Mar 2, 2025
Contributor
There was a problem hiding this comment.
The tests are failing with this message:
invalid rule 'dangerous_xss_unsanitized_input.yml': invalid node type 'argument_list' at line 15 column 0
I'd recommend running globstar test locally to see if all the checkers are running as expected and the test cases are raising errors as expected.
Author
Contributor
|
Adding @sourya-deepsource here to help with the review. |
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
This PR introduces a security checker named
dangerous_xss_unsanitized_inputto detect dangerous DOM manipulation in javascript code. Directly assigning unsanitized user input to DOM properties (such asinnerHTMLorouterHTML) or usingdocument.writecan lead to cross-site scripting (XSS) vulnerabilities. This checker helps in preventing XSS.Detection Logic
innerHTMLorouterHTML.document.writeordocument.writelncalls with unsanitized input.