๐งช OWASP Top 10 Lab โ Stored Cross Site Scripting (XSS)
Category: A05:Injection
๐ง Vulnerability Type
- Stored Cross Site Scripting (Persistent XSS)
- Client-side injection
- Untrusted input rendered without encoding
๐ฏ Objective
Demonstrate a Stored Cross Site Scripting (Persistent XSS) vulnerability using DVWA by injecting
malicious JavaScript that executes for all users viewing stored content.
๐ Lab Environment
- DVWA (Docker)
- Kali Linux
- Browser testing
- Security Level: Low
๐ Payload Used
<script>alert('Stored XSS')</script>
๐ฃ Steps to Reproduce
- Navigate to DVWA โ Stored XSS module
- Enter attacker name and payload in message field
- Submit the form
- Reload the page or revisit as another user
- Observe JavaScript execution
๐ฅ Impact
- Session hijacking
- Credential theft
- Account takeover
- Malicious script execution for all users
๐งช Proof of Concept
The injected payload is stored in the application database and executed whenever
the vulnerable page renders stored content.
Payload Injection
JavaScript Execution Popup
Stored Entries in Guestbook
๐ก Mitigation
- Output encoding (HTML escaping)
- Input sanitization
- Content Security Policy (CSP)
- Framework auto-escaping
๐ง Key Learning
Stored XSS is significantly more dangerous than reflected XSS because payloads persist
in the application and affect every user who loads the page. Proper output encoding
is critical to prevent injection attacks.
๐บ Personal Note
This lab demonstrates real-world persistent XSS behavior commonly seen in comment systems,
ticketing portals, and admin dashboards. Understanding stored XSS is foundational for
modern bug bounty hunting.