Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 1107

Stored XSS

What is Stored XSS?

Stored XSSA persistent cross-site scripting flaw where attacker-supplied script is saved on the server and later executed in every visitor's browser.


Stored XSS (also called persistent XSS) occurs when an application accepts untrusted input, saves it in a database, file system, log, or other backing store, and later renders it into HTML without proper output encoding. Because the payload lives on the server, every user who views the affected page automatically executes the script, making it one of the highest-impact web flaws. Typical targets include comment fields, user profiles, product reviews, and admin dashboards that display log entries. Defenses include context-aware output encoding, a strict Content Security Policy, input validation, and sanitization libraries such as DOMPurify.

Examples

  1. 01

    A blog comment containing <script>fetch('/api/me').then(...)</script> that runs for every reader.

  2. 02

    Attacker stores a payload in their profile name, executing in the admin panel that lists users.

Frequently asked questions

What is Stored XSS?

A persistent cross-site scripting flaw where attacker-supplied script is saved on the server and later executed in every visitor's browser. It belongs to the Attacks & Threats category of cybersecurity.

What does Stored XSS mean?

A persistent cross-site scripting flaw where attacker-supplied script is saved on the server and later executed in every visitor's browser.

How does Stored XSS work?

Stored XSS (also called persistent XSS) occurs when an application accepts untrusted input, saves it in a database, file system, log, or other backing store, and later renders it into HTML without proper output encoding. Because the payload lives on the server, every user who views the affected page automatically executes the script, making it one of the highest-impact web flaws. Typical targets include comment fields, user profiles, product reviews, and admin dashboards that display log entries. Defenses include context-aware output encoding, a strict Content Security Policy, input validation, and sanitization libraries such as DOMPurify.

How do you defend against Stored XSS?

Defences for Stored XSS typically combine technical controls and operational practices, as detailed in the full definition above.

What are other names for Stored XSS?

Common alternative names include: Persistent XSS, Type-2 XSS.

Related terms

See also