Skip to content

In-depth lesson · Stored XSS

Typical fixes

Every point the Stored XSS reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 7 of 7
  1. Reject requests with no Content-Type header and filter the X-Accel-Redirect header in proxy responses.

    Seen in 2 reports
  2. Sanitise or block embedded script in uploaded SVG files.

    Seen in 2 reports
  3. Replace suspicious linked account names with a generic string before rendering them.

    Seen in 1 report
  4. Serve uploaded files with a restrictive Content-Disposition and a non-HTML content type, and sanitise them.

    Seen in 1 report
  5. Escape user-controlled content in generated HTML exports and add a Content-Security-Policy to the generated file.

    Seen in 1 report
  6. Escape placeholder replacements before inserting them into markup.

    Seen in 1 report
  7. Build tooltips with DOM methods rather than concatenating attribute values into a string passed to a re-parsing method.

    Seen in 1 report