Tag

Tips tagged #xss

Published tips with this tag, newest first. Payloads and commands are shown as plain text.

Cross-site scripting (XSS) tips, and how to hunt it

Feed of #xss

Tag #xssRemove tag filter

  • Test API docs for XSS

    When testing an API, look for API documentation pages that may be vulnerable to XSS. Check if the page uses template strings to build HTML, with values from the OpenAPI spec dropped inside, such as content="${something}" or <title>${something}</title>. Try setting the description

    Cross-site scripting (XSS)Discovery

    1 upvote

  • Test template fields for stored XSS

    Test template fields for stored cross-site scripting by submitting content with HTML markup, such as a link or text with angle brackets, and checking if it is executed in the context of a higher-privileged viewer. Try storing a template that contains angle brackets <> and confirm

    Cross-site scripting (XSS)Discovery

  • Bypass regex with global flag

    When a target uses a global regex (/g flag) to validate user input, try sending a large string with a disallowed character at the end to offset the lastIndex property. Then, send a second payload with the malicious input, which may be processed without being blocked by the regex.

    Cross-site scripting (XSS)Discovery

  • Test login redirects for XSS

    Try sending a Location header with a crafted link to target.com to see if it reflects and executes code. If the response redirects to a page that auto-submits a form, it may be vulnerable to XSS. Look for a response that executes code without requiring user interaction. You can…

    Cross-site scripting (XSS)Discovery

  • Test innerHTML sinks for DOM XSS

    Try injecting payloads in the location.search parameter to test for DOM XSS vulnerabilities in innerHTML sinks. This works because user-controlled input in the URL query string can be reflected in the page's DOM. To confirm, look for your payload being executed in the page's con…

    Cross-site scripting (XSS)Discovery

  • Test API doc renderers for XSS

    When testing API documentation tools, look for renderers that convert Markdown to HTML. Check if the renderer allows raw HTML in the input by searching for html: true in the code. Then, verify if the HTML output is properly sanitized. If not, it may be possible to inject malicio…

    Cross-site scripting (XSS)Discovery

  • Test for DOMPurify bypasses

    When a target uses DOMPurify for sanitization, look for custom hooks that may introduce vulnerabilities. Check the uponSanitizeAttribute, uponSanitizeElement, and afterSanitizeAttributes hooks for potential bypasses. Test for namespace confusion and attribute smuggling by inject…

    Cross-site scripting (XSS)Discovery

  • Test Blob URLs for origin recovery

    When a web application uses Blob URLs, test if you can recover the origin by copying and pasting the URL into a new tab. If the window.origin changes from 'null' to the application's origin, you may be able to execute arbitrary JavaScript on that origin. To automate this, use Ja…

    Cross-site scripting (XSS)Exploitation