Software Securityhome
Fix a findingSearch
Tag

Cross-site scripting (XSS)

5 guides tagged Cross-site scripting (XSS), grouped by topic, with the SDLC phase and role each is written for.

SDLC phases
Roles

Application security

4 guides

AI security

1 guide

Practice

Browser lab · Foundation · 20–30 min

XSS lab: Render a model’s answer as text instead of active markup

A report page shows generated answers with a link to the cited source. The renderer inserts both as HTML, so an answer containing an image handler becomes active markup and a javascript: source becomes a clickable script. Repair the text serializer and the DOM renderer.

Browser lab · Foundation · 20–30 min

CORS policy lab: Grant CORS to the right origins only

An API reflects whatever Origin a request carries and allows credentials, so any website can read a signed-in user’s data from it. Repair the CORS policy so it grants access only to the configured origins and keeps caches correct.

Browser lab · Practitioner · 25–40 min

CSP builder lab: Build a strict Content-Security-Policy

A page sends a Content-Security-Policy whose script-src allows any HTTPS origin, so an injected external script runs despite the nonce. Repair the builder so it produces a strict nonce-based policy from the document’s declared needs.

Browser lab · Practitioner · 25–40 min

HTML sanitization lab: Configure a sanitizer for user comments

A comment feature keeps the formatting users submit, but its sanitizer configuration re-enables event handlers, unknown URL schemes and extra tags, so a comment can run script. Repair the configuration so only a small set of formatting tags and safe links survive.

Fix card · CWE-79

Cross-site scripting (XSS)

Cross-site scripting happens when request or stored data is written into a page without encoding for the exact spot it lands in, so the browser runs it as markup or script instead of showing it as text.

All tags, lifecycle stages and roles

Find your next answer

Type to search. Search runs in your browser.

Searches run in your browser, but the host can infer them from the index files they load. The address shows your search so you can bookmark or share it.