Skip to content
XSS Write-up Beginner

Comprehensive Cross Site Scripting Assessment From Reflective Payloads to Persistent Exploits and Practical Mitigations

The report describes cross-site scripting (XSS) vulnerabilities in the Damn Vulnerable Web Application (DVWA) across low, medium, and high security levels. An attacker could inject JavaScript that executes in a victim's browser, potentially stealing session cookies or embedding malicious content.

Kiza Follow

Published on kizerh.medium.com

This project explored the exploitation of Cross-Site Scripting (XSS) vulnerabilities using the Damn Vulnerable Web Application (DVWA). The exercise was designed to simulate real-world web application attacks where user-supplied input is not properly validated or sanitized.

Kiza, on kizerh.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application inserted user-supplied input into HTML output without proper encoding or sanitisation, and the filters used were incomplete blacklists that could be bypassed.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser, leading to session hijacking, credential theft, or embedding of malicious content, though the report only demonstrates alerts and cookie display.

What the attacker needed

DVWA instance running; Valid credentials (admin/password); Victim visits crafted link or page

The fix

The application should use context-aware output encoding and avoid blacklist-based filters, as demonstrated by the bypasses.

How it was found

  1. Log into DVWA with the provided credentials.
  2. Navigate to the XSS (Reflected) module and set security level to Low.
  3. Enter a benign string to confirm input is reflected without encoding.
  4. Replace the string with a script payload and submit to trigger an alert.
  5. Increase security to Medium and attempt the same payload; observe it is blocked.
  6. Review backend code to see a case-sensitive filter, then bypass with mixed-case script tag.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Cross-site scripting (XSS) is a flaw where a website shows user input without cleaning it, so an attacker can slip in JavaScript code. When another person views the page, their browser runs that code as if it came from the trusted site. This can let the attacker steal login cookies or show fake login forms.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.