Skip to content

fix(xss): use waitdialog in dom-xss #11921

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

Merged
merged 2 commits into from
Apr 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions dast/vulnerabilities/xss/dom-xss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ id: dom-xss

info:
name: DOM Cross Site Scripting
author: theamanrawat,AmirHossein Raeisi
author: theamanrawat,AmirHossein Raeisi,dwisiswant0
severity: medium
description: |
Detects DOM-based Cross Site Scripting (XSS) vulnerabilities.
Expand All @@ -11,25 +11,29 @@ info:
remediation: |
Sanitize and validate user input to prevent script injection.
tags: xss,dom,dast,headless

variables:
num: "{{rand_int(10000, 99999)}}"

headless:
- steps:
- action: navigate
args:
url: "{{BaseURL}}"

- action: waitload
- action: waitdialog
name: reflected

payloads:
reflection:
- "'\"><h1>{{num}}</h1>"
- "'\"><script>alert({{num}})</script>"

fuzzing:
- part: query
type: postfix
mode: single
fuzz:
- "{{reflection}}"
- "{{url_encode(reflection)}}"

- part: path
type: postfix
Expand All @@ -38,15 +42,9 @@ headless:
- "{{reflection}}"

stop-at-first-match: true
matchers-condition: and
matchers:
- type: word
part: body
words:
- "<h1>{{num}}</h1>"

- type: word
part: header
words:
- "text/html"
# digest: 4a0a00473045022100a376112ac616c2d38a2243a8543d3497e3882c834b51e2c47b289e43a5b7134e022075dbb9f4451bec92b6385d4db956aec9812f5548795500b322831abd67f03bd7:922c64590222798bb761d5b6d8e72950
- type: dsl
dsl:
- reflected == true
- reflected_message == num
condition: and