π΄ Stored XSS (Vulnerable)
π‘οΈ Stored XSS (Secure)
π§ Attack Analysis
π§ Security Breakdown: Stored XSS
Description:
In the vulnerable version, user input is inserted into the DOM using innerHTML,
which allows execution of arbitrary JavaScript.
How it works:
The browser treats the input as HTML instead of plain text.
This allows attackers to inject scripts that execute when rendered.
Severity: Medium
Impact:
An attacker can execute JavaScript in another userβs browser,
leading to session hijacking, data theft, or phishing attacks.
Example Payload:
<script>alert('XSS')</script>
Fix:
Use textContent instead of innerHTML
or sanitize user input before rendering.
π§ͺ Bug Bounty Lab
This interactive lab simulates common client-side web vulnerabilities including Cross-Site Scripting (XSS), Open Redirects, and Clickjacking.
Each section demonstrates a vulnerable implementation, a secure version, and a breakdown explaining how the vulnerability works, its impact, and how to fix it.
How to use:
- π§ͺ Try entering test payloads in vulnerable inputs
- β οΈ Observe how the application behaves
- π‘οΈ Compare with the secure implementation
- π§ Read the breakdown to understand the vulnerability
π Tester Notes
While building this lab, I focused on understanding how small implementation choices (like using innerHTML or trusting user input) can lead to real security vulnerabilities.
This project helped reinforce how attackers think and how secure coding practices can prevent exploitation.