Stored XSS, or persistent cross-site scripting, is a vulnerability where attacker-controlled input is saved by a web application and later delivered to another user’s browser as active content. Instead of triggering once in a request, the payload sits in a database, profile field, comment, avatar metadata, or uploaded file reference until the page is rendered.
This matters because the script runs in the application’s origin, which can expose session data, perform actions as the victim, or alter what they see. In real attacks, stored XSS often appears in features that accept user content, such as chat messages, bios, file uploads, or profile images. Defenses include strict input validation, output encoding, content security policies, safe file handling, and treating all user-supplied content as untrusted until it is rendered inert. Stored XSS is especially dangerous because one successful injection can affect many users over time.


