Skip to content

Latest commit

 

History

History
107 lines (63 loc) · 2.1 KB

File metadata and controls

107 lines (63 loc) · 2.1 KB

Cross-Site Scripting (Reflected XSS) Report

1. Overview

This report documents a Reflected Cross-Site Scripting (XSS) vulnerability identified in DVWA during security testing.

Testing Type: Offensive + Defensive Analysis
Environment: Local Lab
Security Level Tested: Low


2. Vulnerability Details

  • Vulnerability Name: Reflected XSS
  • Severity: High
  • Category: OWASP Top 10 – Cross-Site Scripting
  • Affected Module: DVWA – XSS (Reflected)

3. Description

The application reflects user input directly into the web page without proper validation or output encoding.

This allows execution of arbitrary JavaScript in the victim's browser.


4. Proof of Concept (PoC)

Payload Used:

<script>alert('XSS')</script>

Steps to Reproduce:

  1. Login to DVWA.
  2. Navigate to XSS (Reflected) module.
  3. Enter the payload in the input field.
  4. Submit.

Observed Result:

A JavaScript alert popup appeared displaying:

XSS

This confirms successful execution of injected script.

proof


5. Technical Analysis

The application directly prints user input into the HTML response without escaping special characters.

Because the input is not sanitized, the browser interprets it as executable JavaScript.


6. Impact Analysis

If exploited in real-world applications, attackers could:

  • Steal session cookies
  • Hijack user sessions
  • Redirect users to malicious websites
  • Perform phishing attacks
  • Modify page content dynamically

7. Root Cause

  • No input validation
  • No output encoding
  • Direct reflection of user input in HTML

8. Risk Classification

Severity Level: High
Reason: Client-side code execution and session hijacking possible.


9. Remediation Strategy

To prevent XSS:

  • Implement output encoding
  • Use htmlspecialchars() in PHP
  • Validate and sanitize user input
  • Use Content Security Policy (CSP)

Secure Example (Conceptual):

echo htmlspecialchars($input, ENT_QUOTES, 'UTF-8');


10. Ethical Disclaimer

This testing was performed in a controlled lab environment (DVWA) strictly for educational purposes.