Cross Site Scripting (XSS) - Reflected

Cross Site Scripting (XSS) - Reflected

Knowledge Base>Cross Site Scripting (XSS) - Reflected

Summary

rXSS allows an attacker to inject malicious Javascirpt code into a web application, leading to potential unauthorized access, data theft, or session hijacking.

Testing methodology

Identify Input SinkReflection in ScriptReflection in TagReflection in ElementInject JS PayloadCheck JS Events on AttributeInject Tag that Runs JSInput is in a Query ParameterInput is in a Body ParameterMethod TamperingIn Body ParameterIn JSON Body ParameterConvert to text/htmlWorking CSRF Payload
Input Enumeration
Reflected Input
In Script
In Tag Attribute
In Element
Deliver Payload
Deliver via URL
POST Based
CSRF
Unenforced Content-Type
Deliver via URL to Attacker Domain

Description

Reflected Cross Site Scripting (rXSS) allows an attacker to inject malicious JavaScript code into a web victim's page. Unlike stored XSS attacks, reflected XSS does not persist on the vulnerable site's database. Instead, the attacker must deliver the payload to the victim (e.g. via a vulnerable URL parameter) and upon page load, the payload will get injected into the victim's browser.

Attackers can exploit this vulnerability by injecting malicious scripts, which are executed by unsuspecting users' browsers, leading to potential theft of sensitive information, session hijacking, or unauthorized access.

Remediations

  • Validate all user inputs on the server side, ensuring that they meet the application's data requirements and expectations. This includes both alphanumeric validations as well as format validations.
  • Encode user-supplied output when it's incorporated into HTML. This makes potentially harmful input safe to display. HTML Entities can be used to safely represent characters, avoiding script interpreta
  • Fewer XSS bugs appear in applications built with modern web frameworks like React that help mitigate against XSS using templating, auto-escaping and more. However, regullary ensure developers aren't b

By using this site you agree to our Terms of Service and Privacy Policy.