Add 29 DOM XSS test cases covering diverse client-side injection patterns#11
Merged
Add 29 DOM XSS test cases covering diverse client-side injection patterns#11
Conversation
Co-authored-by: hahwul <13212227+hahwul@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add multiple DOM XSS test cases with various patterns
Add 29 DOM XSS test cases covering diverse client-side injection patterns
Nov 15, 2025
hahwul
approved these changes
Nov 15, 2025
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.
Expands DOM XSS coverage from 6 to 35 test cases, adding various patterns from simple to advanced complexity as requested.
Changes
Simple DOM manipulation (levels 7-11, 16)
innerHTML/outerHTMLwith location.hash and query paramsimg.src,a.href)innerTextto script tagBrowser object reflection (levels 12-14, 26-28)
document.cookie,window.name,document.referrer,document.URLlocation.search,location.pathnameAdvanced injection vectors (levels 15-25, 29-35)
insertAdjacentHTML,setAttribute,createContextualFragment,DOMParser,execCommandsetTimeout/setIntervalstrings,Functionconstructor,evaltemplate literalsjavascript:protocol injectionExample
Level 22 demonstrates JSON parsing vulnerability:
Payload:
/dom/level22/?query={"message":"<img src=x onerror=alert(1)>"}Coverage
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.