Cross Site Scripting (XSS) - Stored

Cross Site Scripting (XSS) - Stored

Knowledge Base>Cross Site Scripting (XSS) - Stored

Summary

sXSS enables attackers to inject malicious JavaScript code into a web application's database, which is then later reflected to other users, posing risks of unauthorized actions, data manipulation, and potential security breaches.

Testing methodology

Identify Functions Like SupportCollect List of Params from Web Cache or DorkCollect List of Params from Source CodeInject Params with Callback Values like 'img src'Interaction Includes Sensitive Headers or ParametersHTTP or DNS InteractionDeliver Session or Credentials to the AttackerCSRF to Account TakeoverCause Victim to Run Sensitive ActionLead Victim to Internal Service
Entry Points
Potential Entry Points
Found External Callback
Sensitive Information Disclosure
External Interaction to the Attacker's Server
Account Takeover
Internal Service CSRF
CSRF

Description

Stored Cross Site Scripting (sXSS) is a vulnerability that occurs when user-supplied input is stored by a web application and later displayed to other users without proper sanitization. An XSS vulnerability is defined as Stored in cases where the malicious code is stored in the application's database, in which case, the application will display the malicious value to users regularly.

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 interpretations.
  • 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, ensure developers aren't bypassing those same framework benefits by dangerous methods ignoring the framework's default protections.

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