Changes to Cross-site scripting

TechWritereditor · 5 Dec 2026, 05:27 · “New page”

+ added − removed (first version)

Title

Removed:  
Added: Cross-site scripting

Short description

Removed:  
Added: Web flaw that injects scripts into trusted pages

Type

Removed:  
Added: technology

Summary

Removed:  
Added: Cross-site scripting (XSS) is a security flaw in websites that lets an attacker inject malicious scripts into pages viewed by other people. The victim's browser runs the script as if the trusted site had sent it.

Fact box

Removed:  
Added: Type: Web application security vulnerability
Added: Abbreviation: XSS
Added: Name agreed: January 2000, by Microsoft security engineers
Added: Main forms: Reflected, stored, DOM-based
Added: Weakness ID: CWE-79
Added: Main defences: Output encoding, sanitisation, Content Security Policy

Article

Added: **Cross-site scripting** (XSS) is a type of security flaw in websites that lets an attacker slip malicious code, usually [[JavaScript]], into pages that other people then view. The victim's [[Web browser]] has no way to know that the script should not be trusted, so it runs it as if the site itself had sent it.[^1]
 
Added: ## How it works
Added: XSS is a form of injection. It happens when a web application includes input from users in the pages it sends out without first checking or encoding that input.[^1] Browsers normally follow the same-origin policy, under which code from one site cannot reach the data of another. In an XSS attack the attacker gets round this by tricking the target site into running the code within its own context.[^2]
Added:  
Added: There are three main kinds. In reflected XSS the script bounces straight back from the server in a single response, such as an error message or search result. In stored XSS the script is saved on the server, for example in a forum post or comment, and is served to everyone who views that content. DOM-based XSS, identified by Amit Klein in 2005, is a kind of XSS that takes place in code running in the browser. The effects range from annoyance to full takeover of an account, most seriously by stealing the session [[HTTP cookie]] that keeps a user logged in.[^1]
Added:  
Added: ## History
Added: The name was settled by a small group of [[Microsoft]] security engineers in January 2000: several names were discussed on 16 January, and the group agreed on "cross site scripting" the next day. A coordinated advisory with the CERT security centre followed in early February 2000.[^3]
Added:  
Added: ## Defences
Added: MITRE's Common Weakness Enumeration lists XSS as weakness CWE-79 and describes proper output encoding, escaping and quoting as the most effective way to prevent it. Marking session cookies as HttpOnly helps keep them away from scripts.[^4] Mozilla's developer documentation also recommends sanitising HTML and, as a backup, using a strict Content Security Policy that stops the browser running injected code.[^2]
Added:  
Added: The problem remains common. Between July 2024 and July 2025, XSS made up 15% of the important or critical cases handled by the Microsoft Security Response Center, which paid $912,300 in bounty awards for XSS reports.[^5]
Added:  
Added: ## See also
Added: - [[JavaScript]]
Added: - [[HTTP cookie]]
Added: - [[Web browser]]
Added: - [[Phishing]]

Sources

Removed:  
Added: Cross Site Scripting (XSS) | https://community.owasp.org/attacks/xss/ | OWASP Foundation
Added: Cross-site scripting (XSS) | https://developer.mozilla.org/en-US/docs/Web/Security/Attacks/XSS | Mozilla (MDN Web Docs)
Added: Happy 10th birthday Cross-Site Scripting! | https://learn.microsoft.com/en-us/archive/blogs/dross/happy-10th-birthday-cross-site-scripting | Microsoft | 2009-12-15
Added: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | https://cwe.mitre.org/data/definitions/79.html | MITRE
Added: Why XSS still matters: MSRC's perspective on a 25-year-old threat | https://www.microsoft.com/msrc/blog/2025/09/why-xss-still-matters-msrcs-perspective-on-a-25-year-old-threat | Microsoft Security Response Center | 2025-09-04

Categories

Removed:  
Added: Online security
Added: Internet

Other names

Removed:  
Added: XSS
Added: Cross site scripting
Added: CSS attack