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 401 to 450 of 476
  1. Ship a direct fix and add a strict content security policy as a broader mitigation.

    Seen in 1 report
  2. Specify a target origin when using window.postMessage.

    Seen in 1 report
  3. Strip data attributes that the site's JavaScript uses to choose request endpoints.

    Seen in 1 report
  4. Strip or sanitise EXIF metadata from uploaded images before serving them.

    Seen in 1 report
  5. Strip SVG script elements as well as HTML script elements when serialising MHTML.

    Seen in 1 report
  6. Strip unclosed tags as well as complete tags when sanitising names.

    Seen in 1 report
  7. Replace suspicious linked account names with a generic string.

    Seen in 1 report
  8. Remove the reflected parameter from the page.

    Seen in 1 report
  9. Address the WebKit issue with improved checks.

    Seen in 1 report
  10. Treat an empty digest list as failure rather than success in signature-based SRI.

    Seen in 1 report
  11. Update bundled JavaScript libraries to patched versions.

    Seen in 1 report
  12. Update bundled third-party software such as noVNC in packaging.

    Seen in 1 report
  13. Update jQuery to a version without known prototype pollution and DOM XSS issues.

    Seen in 1 report
  14. Update Swagger UI and its DomPurify dependency to versions that are not bypassable.

    Seen in 1 report
  15. Update Swagger UI to a version that does not load arbitrary JavaScript through configUrl.

    Seen in 1 report
  16. Update the bundled sanitiser library.

    Seen in 1 report
  17. Update WordPress core and plugins and sanitise input shown in admin dashboards.

    Seen in 1 report
  18. Use a Content Security Policy with a nonce so inline scripts do not execute.

    Seen in 1 report
  19. Use a cryptographically secure generator for security-sensitive callback identifiers.

    Seen in 1 report
  20. Use a global regular expression or a replace-all function in the escape routine.

    Seen in 1 report
  21. Use an allowlist sanitiser for SVG rather than a blocklist of script elements and on* attributes.

    Seen in 1 report
  22. Use attribute-safe escaping for search input.

    Seen in 1 report
  23. Use context-aware output encoding instead of a blacklist of handlers.

    Seen in 1 report
  24. Use output encoding instead of a homemade keyword blocklist.

    Seen in 1 report
  25. Use proper output encoding instead of a denylist of event handlers.

    Seen in 1 report
  26. Use safe output encoding instead of relying on a WAF.

    Seen in 1 report
  27. Use the same whitespace list in the extension CSP validator and the network service parser.

    Seen in 1 report
  28. Validate a url parameter against allowed HTTP(S) values before assigning it to location.href.

    Seen in 1 report
  29. Validate and encode the error query parameter before display.

    Seen in 1 report
  30. Validate and encode the task identifier parameter.

    Seen in 1 report
  31. Validate and encode user-supplied data on the single sign-on page.

    Seen in 1 report
  32. Validate and escape theme colour values before inserting them into stylesheets.

    Seen in 1 report
  33. Validate and output-encode configuration values such as site_index.

    Seen in 1 report
  34. Validate and sanitise input before encoding it into a QR code.

    Seen in 1 report
  35. Validate and store the same copy of a duplicated parameter.

    Seen in 1 report
  36. Validate canonical URLs before storing them when bookmarking.

    Seen in 1 report
  37. Validate cookie-supplied configuration against an allowlist before using it in a script source.

    Seen in 1 report
  38. Validate deep link URLs before loading them in a WebView and restrict bridge methods to trusted pages.

    Seen in 1 report
  39. Validate email content to prevent CSS injection affecting signed message display.

    Seen in 1 report
  40. Validate file content server-side and enforce allowed types.

    Seen in 1 report
  41. Validate file contents rather than trusting the client content type.

    Seen in 1 report
  42. Validate file type and content on the upload endpoint.

    Seen in 1 report
  43. Validate file types strictly and do not serve user-supplied HTML as text/html.

    Seen in 1 report
  44. Validate List-Unsubscribe values before using them in requests or rendering.

    Seen in 1 report
  45. Validate message origins in transport implementations and avoid JSONP auto-detection.

    Seen in 1 report
  46. Validate that a stored redirect_uri is an allowed HTTP(S) URL.

    Seen in 1 report
  47. Validate that a URL used as a link href is a safe scheme.

    Seen in 1 report
  48. Validate that link fields contain only http or https URLs.

    Seen in 1 report
  49. Validate that link schemes are http or https before storing.

    Seen in 1 report
  50. Validate that redirect targets use a safe scheme such as https.

    Seen in 1 report