Cross-Site Scripting
Understand how untrusted input reaches the browser across stored, reflected and DOM contexts.
Scenario
The sandbox renders user-controlled input in several places. In at least one, the output isn't encoded for its context, allowing a harmless marker script to execute.
Objective
Trigger the sandbox's benign XSS marker and define the output encoding and CSP that neutralise it.
Your approach
- Trace each place untrusted input is reflected into the page.
- Determine the output context (HTML, attribute, JS, URL) for each.
- Demonstrate execution of the provided benign marker — no real payloads needed.
- Note whether a Content-Security-Policy is present and effective.
- Specify the context-appropriate encoding and CSP that stop it.
Rules of engagement
Run this lab only in the isolated environment provided — the downloadable bundle runs on your own machine in a private Docker network. Only interact with the lab's target, keep testing non-destructive, and never use these techniques on systems you don't own or aren't authorised to test. When you've met the objective, submit the flag (format SS{...}) to score.
Remediation focus
Apply context-aware output encoding, rely on framework auto-escaping, avoid dangerous sinks, and deploy a strong Content-Security-Policy as defence in depth.
Deliverable
Write up what you did, what you observed, the business impact, and a clear remediation — exactly as you would in a professional report.
Hints
Hint 1
Re-read the matching knowledge-base entry before you start.
Hint 2
Capture reproducible evidence as you go — you'll need it for the write-up.
Hint 3
For every finding, identify the single control that would prevent it.
Study the theory
Read the Cross-Site Scripting (XSS) knowledge-base entry