What is cross-site scripting?

DefinitionCross-site scripting (XSS) is a web security vulnerability that lets an attacker inject malicious scripts into pages viewed by other users, where the scripts run with the trust and access of the vulnerable site.

Also known as XSS

XSS happens when a site includes untrusted input, such as a comment, a search term or a URL parameter, in a page without properly escaping or sanitizing it. In stored XSS the malicious script is saved on the server and served to every visitor, in reflected XSS it arrives through a crafted link, and in DOM-based XSS the site's own JavaScript writes the input into the page. Once running, the script can steal session data, change content or act as the user.

XSS is one of the most common web vulnerabilities and a frequent reason for security releases in platforms such as WordPress and its plugins. Defenses include escaping output for its context, sanitizing any HTML that users can submit, using frameworks that escape by default, and adding a Content Security Policy and Trusted Types to limit which scripts can run.

cross-site scripting resources

Topics: Privacy and security, Web development

Cite this definition
APA

What is cross-site scripting? (2026, November 22). Glossary. https://glossary.io/cross-site-scripting/

MLA

“What Is Cross-Site Scripting?” Glossary, Coywolf, 22 Nov. 2026, glossary.io/cross-site-scripting/.

Chicago

“What Is Cross-Site Scripting?” Glossary. Coywolf. November 22, 2026. https://glossary.io/cross-site-scripting/.

HTML link
<a href="https://glossary.io/cross-site-scripting/">What is cross-site scripting?</a>

Published