Skip to content
ShankarStack
IntermediateIndividualWeb Security120 pts

Cross-Site Scripting

Understand how untrusted input reaches the browser across stored, reflected and DOM contexts.

This is an isolated, sandboxed environment created only for you. Techniques here apply only to systems you own or are authorised to test.

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

  1. Trace each place untrusted input is reflected into the page.
  2. Determine the output context (HTML, attribute, JS, URL) for each.
  3. Demonstrate execution of the provided benign marker — no real payloads needed.
  4. Note whether a Content-Security-Policy is present and effective.
  5. 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

→