Skip to content

In-depth lesson · XSS

Typical fixes

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

Back to the lesson 251 to 300 of 476
  1. Make the WAF and the application parse duplicate or malformed query parameters consistently and output-encode user input.

    Seen in 1 report
  2. Mark the storefront password cookie HttpOnly.

    Seen in 1 report
  3. Match the Content-Type header exactly rather than searching for the MIME string anywhere.

    Seen in 1 report
  4. Microsoft fixed the filter bypass in the December patch.

    Seen in 1 report
  5. Neutralise carriage-return and line-feed characters and HTML-escape the file name value.

    Seen in 1 report
  6. Normalise the path before checking the GitHub organisation.

    Seen in 1 report
  7. Omit or mask the password in response bodies.

    Seen in 1 report
  8. Output-encode a nextUrl parameter before inserting it into an anchor tag and restrict redirectUrl to allowed values.

    Seen in 1 report
  9. Output-encode filenames shown in the favourites view.

    Seen in 1 report
  10. Output-encode hidden form fields echoed into responses.

    Seen in 1 report
  11. Output-encode member display names before inserting them into invitation email templates.

    Seen in 1 report
  12. Output-encode or sanitise the maintenance mode message.

    Seen in 1 report
  13. Output-encode organisation names returned by the autocomplete endpoint.

    Seen in 1 report
  14. Output-encode stored profile fields such as the Signature when rendering them.

    Seen in 1 report
  15. Output-encode the media identifier and validate it as numeric.

    Seen in 1 report
  16. Parse and encode input properly instead of stripping text between angle brackets with a greedy regular expression.

    Seen in 1 report
  17. Parse and validate the redirect target against an allowlist rather than checking the string suffix, and avoid double decoding.

    Seen in 1 report
  18. Parse the URL and compare the hostname exactly instead of substring matching.

    Seen in 1 report
  19. Prevent closing the script tag and encode all alert parameters.

    Seen in 1 report
  20. Prevent linked pages from accessing window.opener.

    Seen in 1 report
  21. Recognise HTML-encoded colons with or without trailing semicolons in the protocol check.

    Seen in 1 report
  22. Reject javascript and data schemes as redirect targets.

    Seen in 1 report
  23. Reject javascript scheme redirect URIs and redirect with a 302 rather than returning the URI in a 200 body.

    Seen in 1 report
  24. Reject javascript: and other non-web schemes in reader mode URL parameters.

    Seen in 1 report
  25. Reject javascript: URLs supplied in the query string of privileged internal pages.

    Seen in 1 report
  26. Reject javascript: values in the returnTo parameter.

    Seen in 1 report
  27. Reject malformed percent sequences in the URL decoder.

    Seen in 1 report
  28. Reject requests with control characters in a redirect parameter instead of dropping the Location header and reflecting the value.

    Seen in 1 report
  29. Reject requests with no Content-Type header and always set a safe content type.

    Seen in 1 report
  30. Remove the custom sanitiser callback or align its parsing with the browser.

    Seen in 1 report
  31. Render task instance attributes as text rather than via innerHTML and validate URLs against a scheme allowlist.

    Seen in 1 report
  32. Replace blacklist filtering with a parser-based allowlist sanitiser and verify executable vectors are removed while layout is preserved.

    Seen in 1 report
  33. Require a scheme prefix and validate URL fields in the API.

    Seen in 1 report
  34. Require authentication and sanitise ticket input.

    Seen in 1 report
  35. Require authentication on the store admin page and encode promo code input.

    Seen in 1 report
  36. Reset or blank the address bar when opening non-http URIs in a new tab.

    Seen in 1 report
  37. Resolve and validate the full target of a use element href rather than checking a prefix.

    Seen in 1 report
  38. Restrict attachment file types and force download instead of serving inline.

    Seen in 1 report
  39. Restrict auto-linking to safe schemes such as http and https.

    Seen in 1 report
  40. Restrict embedded hyperlink URL schemes to safe ones.

    Seen in 1 report
  41. Restrict externally connectable domains to specific origins rather than a whole domain.

    Seen in 1 report
  42. Restrict fetched hosts and file types and sanitise fetched output.

    Seen in 1 report
  43. Restrict or sanitise Link headers in the PDF viewer.

    Seen in 1 report
  44. Restrict post type capabilities and sanitise meta values before output.

    Seen in 1 report
  45. Restrict profile website URLs to http and https schemes.

    Seen in 1 report
  46. Restrict scanned text to http and https schemes before passing it to a web view.

    Seen in 1 report
  47. Restrict server-side fetchers to allowed destinations and block internal addresses.

    Seen in 1 report
  48. Restrict the artwork URL scheme to safe values.

    Seen in 1 report
  49. Restrict uploads to safe types and serve them with a non-HTML content type from a separate origin.

    Seen in 1 report