Quick answer
Cross-site scripting (XSS) is a web vulnerability that lets an attacker run their own script in another user's browser, within your site. It is used to steal session tokens, act as the victim, capture keystrokes or change what the page shows. Variants are stored, reflected and DOM-based XSS.
On this page
How It Works
When an application includes user-supplied content in a page without encoding it for the right context, an attacker's script runs as if it came from your site. Stored XSS persists, for example in a comment or profile field, and affects every viewer; reflected XSS is delivered through a crafted link; DOM XSS happens entirely in client-side code. AI features that render model output as HTML have reintroduced XSS into modern applications.
Why It Matters
XSS in an administrative interface can lead to full account takeover. In customer applications it enables fraud and data theft at scale.
How to Test for It
- Test every place user or third-party content is displayed, including rich text, file names and AI-generated output.
- Test client-side code for DOM-based sinks.
- Check Content Security Policy and cookie flags.
- Confirm impact by demonstrating session or action hijacking in an authorised test.
How to Reduce the Risk
Encode output for its context, use frameworks that escape by default, sanitise any allowed HTML with a maintained library, apply a strict Content Security Policy, set HttpOnly and SameSite cookies, and treat AI model output as untrusted.
Regulatory and Framework Context
For Australian organisations, XSS findings in customer-facing portals are relevant to Privacy Act obligations to protect personal information.
Latest intel on this topic
- Critical vulnerabilities in PHPASD's ACSC · 21 October 2026
- Video: Web Application Security FundamentalsEmbrace The Red · 6 September 2021
- Pass the Cookie and Pivot to the CloudsEmbrace The Red · 16 December 2018
Updated hourly from the daily briefing.
Common questions
What is the difference between stored and reflected XSS?
Stored XSS is saved by the application and shown to other users; reflected XSS is triggered by a crafted link the victim clicks.
Does a Content Security Policy fix XSS?
A strict policy greatly reduces impact, but the underlying flaw should still be fixed.
For testers: finding write-ups
How this shows up in a penetration test report, with severity, verification and remediation, in the StrikeOps Findings Library.
Change log
- 13 November 2026First published.