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 201 to 250 of 476
  1. Escape hash keys when converting to JSON, as values already are.

    Seen in 1 report
  2. Escape name values in email templates.

    Seen in 1 report
  3. Escape or decode parameters inserted into JavaScript string literals rather than relying on browser apostrophe encoding.

    Seen in 1 report
  4. Escape or sanitise allowed HTML elements in name fields before rendering.

    Seen in 1 report
  5. Escape quotes and apply attribute-context encoding, not just angle bracket encoding.

    Seen in 1 report
  6. Escape quotes in the namespace URL when serialising the @namespace rule.

    Seen in 1 report
  7. Escape search and category parameters before reflecting them.

    Seen in 1 report
  8. Escape search parameters embedded into CSS blocks.

    Seen in 1 report
  9. Escape single quotes and other characters when embedding input into JSON in a script context.

    Seen in 1 report
  10. Escape SMTP error text before inserting it into the page.

    Seen in 1 report
  11. Escape the API title and description before inserting them into generated HTML.

    Seen in 1 report
  12. Escape the customer email address in the packing slip template.

    Seen in 1 report
  13. Escape the request URI before inserting it into an anchor href.

    Seen in 1 report
  14. Escape the review URL in every attribute, including href, not just title.

    Seen in 1 report
  15. Escape User-Agent and Referer headers before storing them in the log page.

    Seen in 1 report
  16. Escape user-supplied input before inserting it into email HTML.

    Seen in 1 report
  17. Escape usernames instead of using Twig's raw filter.

    Seen in 1 report
  18. Fall back to a safe default when no Content-Type header is present instead of trusting the type attribute.

    Seen in 1 report
  19. Filter the URL segment in the analytics callback path.

    Seen in 1 report
  20. Handle duplicate parameters and sanitise every occurrence, not just the first.

    Seen in 1 report
  21. Handle lesser-used styling attributes in the sanitiser and escape content inserted into JavaScript template strings.

    Seen in 1 report
  22. Handle nested tags consistently across parser implementations.

    Seen in 1 report
  23. HTML-encode angle brackets and set HttpOnly on session cookies.

    Seen in 1 report
  24. HTML-encode campaign names before outputting them into admin pages.

    Seen in 1 report
  25. HTML-encode circle display names before rendering in the search UI.

    Seen in 1 report
  26. HTML-encode logged request data before showing it in an admin dashboard.

    Seen in 1 report
  27. HTML-encode multipart field names and add CSRF protection to add-to-cart.

    Seen in 1 report
  28. HTML-encode or validate the page format parameter before echoing it.

    Seen in 1 report
  29. HTML-encode output placed inside attributes and validate the search term.

    Seen in 1 report
  30. HTML-encode reflected values in error pages.

    Seen in 1 report
  31. HTML-encode script standard output before rendering.

    Seen in 1 report
  32. HTML-encode the comment value and add a CSRF token to the comment endpoint.

    Seen in 1 report
  33. HTML-encode the current folder value before inserting it into the page.

    Seen in 1 report
  34. HTML-encode the Display Name before rendering it.

    Seen in 1 report
  35. HTML-encode user-controlled PDF metadata and filenames before displaying them in chat.

    Seen in 1 report
  36. HTML-encode user-supplied message bodies before inserting them into outgoing emails.

    Seen in 1 report
  37. HTML-escape error messages and validate the redirect parameter.

    Seen in 1 report
  38. HTML-escape the region parameter before reflection.

    Seen in 1 report
  39. HTML-escape tracker names on the conversion statistics page.

    Seen in 1 report
  40. Insert the placeholder as text rather than assigning it to innerHTML.

    Seen in 1 report
  41. Insert title and subtitle as text rather than concatenating them into an HTML string.

    Seen in 1 report
  42. Inspect compressed response bodies at the WAF.

    Seen in 1 report
  43. Invalidate existing sessions when a password changes.

    Seen in 1 report
  44. Isolate javascript: URLs opened via new windows from the top-level origin.

    Seen in 1 report
  45. Keep a content security policy in place to mitigate script injection through the PDF rendering SDK.

    Seen in 1 report
  46. Keep JavaScript libraries up to date to avoid known vulnerabilities.

    Seen in 1 report
  47. Linkify mentions and references during markdown parsing rather than as post-processing on rendered HTML.

    Seen in 1 report
  48. Make the browser ignore an injected base element for relative URL resolution when CSP restricts base-uri.

    Seen in 1 report
  49. Make the caching layer and application parse duplicate cookies consistently and sanitise cookie values reflected into script contexts.

    Seen in 1 report
  50. Make the sanitiser regex account for newlines.

    Seen in 1 report