DELAPARRA
Index
Color
NL
Category: Core glossary

XSS (Cross-Site Scripting)

Explained by Updated

What is XSS (Cross-Site Scripting)?

XSS (Cross-Site Scripting): A security vulnerability where an attacker injects malicious scripts into web pages viewed by other users. Prevented by escaping user-supplied output and using a Content Security Policy (CSP). Ranked in the OWASP Top 10. Cross-site scripting, XSS, happens when an attacker manages to get their own JavaScript running on your pages in other users' browsers. Typically, user input such as a comment or a name is shown on a page without being escaped, and it contains a script.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about XSS (Cross-Site Scripting)

How is XSS (Cross-Site Scripting) used in practice?

That script runs with the victim's session. It can read data on the page, perform actions as the user or send them to a fake login form. XSS has been in the OWASP Top 10 for many years.

What should you keep in mind with XSS (Cross-Site Scripting)?

The main defence is escaping output by default, which templating engines like Blade, Twig and React do automatically. Be very careful wherever you bypass that, such as {!! !!} in Blade or dangerouslySetInnerHTML in React. A strict Content-Security-Policy adds a second line of defence, and HttpOnly cookies keep session cookies out of reach of injected scripts.

At a glance

CategoryCore glossary
Explained by
Updated

More Core glossary terms

All terms starting with X

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.