Stored XSS
Persistent XSS where the payload is saved by the application (database, file, config) and served unescaped to other users later, so it fires without the victim clicking an attacker link — the highest-baseline-impact XSS class.
How it works
Attacker input is persisted and rendered to viewers who never interact with the attacker. Impact scales with who views it: a payload in a public comment hits every reader; one in an admin-only view becomes Blind XSS. Because it self-triggers in an authenticated victim’s session, stored XSS is the natural precursor to Account Takeover, privilege escalation, and worming.
Common stored sinks that evade naive filters:
- Profile fields (name, bio, avatar), comments, posts, filenames, markdown, rich-text/WYSIWYG output.
- Non-obvious fields parsed later: ID3 tags (Ampache song lyrics), post slugs (WriteFreely), SVG/HTML uploads (SVG and File Upload XSS), topic/MIME names (MQTTX, EdgeEver), custom-property options (GitHub Enterprise Server).
- Second-order: value stored safely in one context, rendered unsafely in another (markdown renderer trusting its own output; Semantic MediaWiki property labels).
Techniques / payloads
- Mapping: submit a unique marker per field, then grep every rendered surface (your profile, others’ views, admin tooling, exports, emails). Use Burp to correlate input→output points.
- Breakout mirrors Reflected XSS but you also control persistence/format: markdown
[x](javascript:alert(1)), HTML in a field claimed to be plain text, event handlers surviving an attribute-level sanitizer. - Framework-specific sinks: jQuery
.html()(forum-java), Alpinex-directives (Axeloz), Angular template compiler schema gaps (CVE-2025-66412 via SVG animation/MathML),srcdoc(SunEditor). - Privilege escalation: inject into a field rendered inside a higher-privileged user’s session. Contributor → admin by planting a payload an admin will open (The Events Calendar CVE-2026-123464; Pretalx CVE-2026-41241 forcing talk acceptance).
Notable cases
- XSS → RCE in Electron/desktop renderers: Opera My Flow (Renwa), MeshCentral, DbGate (CVE-2026-34725), Storybook dev server (CVE-2026-27148, via WebSocket). The renderer has Node/privileged context, so DOM injection becomes code execution.
- Stored XSS → server RCE: Magento 2.3.1 unauthenticated stored XSS chained to authenticated PHAR deserialization; PivotX CMS (CVE-2025-52367).
- Mass impact: “stored XSS on thousands of webshops” via a shared component; cache-poisoned stored XSS (PayPal $18.9k, GitLab DesignReferenceFilter $16k).
- Session theft → ATO: unescaped bio field → admin session hijack (spyboy); GitHub Enterprise Server stored XSS used to add an attacker SSH key to another user.
- Admidio 5.0.0–5.0.17 (CVE-2026-134262, critical): role administrators put quote-breaking role names into an unencoded
data-messageattribute (modules/profile/roles_functions.php). When a full administrator views the profile, the script steals the CSRF token and assigns the attacker more privileges (GHSA-956j-82cc-g6jm). - rConfig Core < 8.2.17 / Pro < 8.4.0 (CVE-2026-135693, critical): device-sourced text is a second-order sink. Banners, interface descriptions, ACL remarks and SNMP locations collected from network gear were rendered with Vue
v-htmlin the Config Search “View Matches” dialog. Script in the viewer’s session could then read stored configurations containing secrets (GHSA-567q-942h-jc5g). - Community Store for Concrete CMS < 2.8.0 (CVE-2026-135689): an unauthenticated guest checkout used a quoted email local part containing markup. It executed in the store manager’s session on
dashboard/store/orders.php(GHSA-h5vx-m44v-9592). - Zimbra, three years running: CVE-2022-24682 (calendar-invite attribute, exploited as a zero-day in “Operation EmailThief”), CVE-2023-45206 (help-document endpoint) and CVE-2024-45510 (contact fields in the Modern UI, fired on simply viewing contacts) show one codebase repeating the class (isv0x1).
Defenses
- Encode on output for the exact render context; treat every “plain text” field as untrusted HTML when it may be rendered as HTML later.
- Sanitize rich text/markdown with a vetted allowlist sanitizer (DOMPurify) — and know its limits (Mutation XSS).
- Serve user uploads from a separate origin with
Content-Disposition: attachmentandX-Content-Type-Options: nosniff(SVG and File Upload XSS). - Defense-in-depth: Content Security Policy,
HttpOnlycookies, and move session tokens out of JS-readablelocalStorage.
Related
- Cross-Site Scripting · Reflected XSS · Blind XSS · SVG and File Upload XSS · Account Takeover · Content Security Policy · Unrestricted File Upload
Sources
- Testing for stored XSS with Burp Suite · original
- Contributor to Administrator: Stored XSS in The Events Calendar · original
- Critical Stored XSS in Pretalx (CVE-2026-41241) · original
- Magento 2.3.1: Unauthenticated Stored XSS to RCE · original
- Stored XSS in My Flow to RCE in Opera Browser · original
- MeshCentral: From XSS to RCE · original
- Stored XSS Through a Markdown Sanitization Gap · original
- Stored XSS on thousands of webshops · original
- Stored XSS to Steal Sessions · original
- GitHub Enterprise Server stored XSS · original
- Admidio critical stored XSS · original
- rConfig stored cross-site scripting (critical) · original
- Community Store for Concrete CMS stored XSS · original
- XSS Explained: From a Simple alert(1) to Real-World Impact CVEs · original