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.
-
Ship a direct fix and add a strict content security policy as a broader mitigation.
Seen in 1 report
-
Specify a target origin when using window.postMessage.
-
Strip data attributes that the site's JavaScript uses to choose request endpoints.
Seen in 1 report
-
Strip or sanitise EXIF metadata from uploaded images before serving them.
Seen in 1 report
-
Strip SVG script elements as well as HTML script elements when serialising MHTML.
Seen in 1 report
-
Strip unclosed tags as well as complete tags when sanitising names.
Seen in 1 report
-
Replace suspicious linked account names with a generic string.
Seen in 1 report
-
Remove the reflected parameter from the page.
Seen in 1 report
-
Address the WebKit issue with improved checks.
-
Treat an empty digest list as failure rather than success in signature-based SRI.
Seen in 1 report
-
Update bundled JavaScript libraries to patched versions.
Seen in 1 report
-
Update bundled third-party software such as noVNC in packaging.
Seen in 1 report
-
Update jQuery to a version without known prototype pollution and DOM XSS issues.
-
Update Swagger UI and its DomPurify dependency to versions that are not bypassable.
Seen in 1 report
-
Update Swagger UI to a version that does not load arbitrary JavaScript through configUrl.
Seen in 1 report
-
Update the bundled sanitiser library.
Seen in 1 report
-
$2,000 Medium
-
-
Update WordPress core and plugins and sanitise input shown in admin dashboards.
Seen in 1 report
-
Use a Content Security Policy with a nonce so inline scripts do not execute.
Seen in 1 report
-
Use a cryptographically secure generator for security-sensitive callback identifiers.
-
Use a global regular expression or a replace-all function in the escape routine.
Seen in 1 report
-
Use an allowlist sanitiser for SVG rather than a blocklist of script elements and on* attributes.
Seen in 1 report
-
Use attribute-safe escaping for search input.
-
Use context-aware output encoding instead of a blacklist of handlers.
Seen in 1 report
-
Use output encoding instead of a homemade keyword blocklist.
Seen in 1 report
-
Use proper output encoding instead of a denylist of event handlers.
Seen in 1 report
-
Use safe output encoding instead of relying on a WAF.
Seen in 1 report
-
Use the same whitespace list in the extension CSP validator and the network service parser.
Seen in 1 report
-
Validate a url parameter against allowed HTTP(S) values before assigning it to location.href.
-
Validate and encode the error query parameter before display.
Seen in 1 report
-
Validate and encode the task identifier parameter.
Seen in 1 report
-
Validate and encode user-supplied data on the single sign-on page.
-
Validate and escape theme colour values before inserting them into stylesheets.
Seen in 1 report
-
Validate and output-encode configuration values such as site_index.
-
Validate and sanitise input before encoding it into a QR code.
Seen in 1 report
-
Validate and store the same copy of a duplicated parameter.
Seen in 1 report
-
Validate canonical URLs before storing them when bookmarking.
Seen in 1 report
-
Validate cookie-supplied configuration against an allowlist before using it in a script source.
-
Validate deep link URLs before loading them in a WebView and restrict bridge methods to trusted pages.
Seen in 1 report
-
Validate email content to prevent CSS injection affecting signed message display.
Seen in 1 report
-
Validate file content server-side and enforce allowed types.
Seen in 1 report
-
Validate file contents rather than trusting the client content type.
Seen in 1 report
-
Validate file type and content on the upload endpoint.
Seen in 1 report
-
Validate file types strictly and do not serve user-supplied HTML as text/html.
Seen in 1 report
-
Validate List-Unsubscribe values before using them in requests or rendering.
Seen in 1 report
-
Validate message origins in transport implementations and avoid JSONP auto-detection.
Seen in 1 report
-
Validate that a stored redirect_uri is an allowed HTTP(S) URL.
Seen in 1 report
-
Validate that a URL used as a link href is a safe scheme.
Seen in 1 report
-
Validate that link fields contain only http or https URLs.
Seen in 1 report
-
Validate that link schemes are http or https before storing.
Seen in 1 report
-
Validate that redirect targets use a safe scheme such as https.
Seen in 1 report