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.
-
Make the WAF and the application parse duplicate or malformed query parameters consistently and output-encode user input.
Seen in 1 report
-
Mark the storefront password cookie HttpOnly.
Seen in 1 report
-
Match the Content-Type header exactly rather than searching for the MIME string anywhere.
Seen in 1 report
-
Microsoft fixed the filter bypass in the December patch.
Seen in 1 report
-
Neutralise carriage-return and line-feed characters and HTML-escape the file name value.
Seen in 1 report
-
Normalise the path before checking the GitHub organisation.
-
Omit or mask the password in response bodies.
Seen in 1 report
-
Output-encode a nextUrl parameter before inserting it into an anchor tag and restrict redirectUrl to allowed values.
Seen in 1 report
-
Output-encode filenames shown in the favourites view.
Seen in 1 report
-
Output-encode hidden form fields echoed into responses.
Seen in 1 report
-
Medium
-
-
Output-encode member display names before inserting them into invitation email templates.
Seen in 1 report
-
Output-encode or sanitise the maintenance mode message.
Seen in 1 report
-
Output-encode organisation names returned by the autocomplete endpoint.
Seen in 1 report
-
Output-encode stored profile fields such as the Signature when rendering them.
Seen in 1 report
-
$50 Medium
-
-
Output-encode the media identifier and validate it as numeric.
-
Parse and encode input properly instead of stripping text between angle brackets with a greedy regular expression.
Seen in 1 report
-
Parse and validate the redirect target against an allowlist rather than checking the string suffix, and avoid double decoding.
-
Parse the URL and compare the hostname exactly instead of substring matching.
Seen in 1 report
-
Prevent closing the script tag and encode all alert parameters.
Seen in 1 report
-
Prevent linked pages from accessing window.opener.
Seen in 1 report
-
Recognise HTML-encoded colons with or without trailing semicolons in the protocol check.
-
Reject javascript and data schemes as redirect targets.
Seen in 1 report
-
Info
-
-
Reject javascript scheme redirect URIs and redirect with a 302 rather than returning the URI in a 200 body.
Seen in 1 report
-
Reject javascript: and other non-web schemes in reader mode URL parameters.
Seen in 1 report
-
Reject javascript: URLs supplied in the query string of privileged internal pages.
Seen in 1 report
-
Reject javascript: values in the returnTo parameter.
Seen in 1 report
-
Reject malformed percent sequences in the URL decoder.
Seen in 1 report
-
Reject requests with control characters in a redirect parameter instead of dropping the Location header and reflecting the value.
Seen in 1 report
-
Reject requests with no Content-Type header and always set a safe content type.
Seen in 1 report
-
Remove the custom sanitiser callback or align its parsing with the browser.
Seen in 1 report
-
$1,250 High
-
-
Render task instance attributes as text rather than via innerHTML and validate URLs against a scheme allowlist.
-
Replace blacklist filtering with a parser-based allowlist sanitiser and verify executable vectors are removed while layout is preserved.
Seen in 1 report
-
Require a scheme prefix and validate URL fields in the API.
-
Require authentication and sanitise ticket input.
Seen in 1 report
-
Require authentication on the store admin page and encode promo code input.
Seen in 1 report
-
Reset or blank the address bar when opening non-http URIs in a new tab.
Seen in 1 report
-
Resolve and validate the full target of a use element href rather than checking a prefix.
Seen in 1 report
-
Restrict attachment file types and force download instead of serving inline.
Seen in 1 report
-
Restrict auto-linking to safe schemes such as http and https.
Seen in 1 report
-
Restrict embedded hyperlink URL schemes to safe ones.
Seen in 1 report
-
Restrict externally connectable domains to specific origins rather than a whole domain.
Seen in 1 report
-
Restrict fetched hosts and file types and sanitise fetched output.
Seen in 1 report
-
Restrict or sanitise Link headers in the PDF viewer.
Seen in 1 report
-
Restrict post type capabilities and sanitise meta values before output.
Seen in 1 report
-
Restrict profile website URLs to http and https schemes.
Seen in 1 report
-
Restrict relativeRootPath to the same origin.
-
Restrict scanned text to http and https schemes before passing it to a web view.
Seen in 1 report
-
Restrict server-side fetchers to allowed destinations and block internal addresses.
Seen in 1 report
-
Restrict the artwork URL scheme to safe values.
Seen in 1 report
-
Restrict uploads to safe types and serve them with a non-HTML content type from a separate origin.
Seen in 1 report