Skip to content

In-depth lesson · Stored XSS

Tips for beginners

Every point the Stored XSS reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 14 of 14
  1. Start by mapping all features that accept user input and later display it to others. Focus on profile fields, comments, file uploads, markdown editors, and any place where your input is shown to a different user or an admin. Use a unique marker to track where your input appears.

    Seen in 4 reports
  2. Test file upload features carefully, especially for SVG files and file names. Upload a file with a name containing HTML markup and check if directory listings or file managers render it unescaped. Also test if uploaded SVGs are served with a content type that allows script execution.

    Seen in 4 reports
  3. For markdown or rich-text editors, try injecting markup through links, images, or embedded objects. Check if the rendered output executes script, and test bypasses such as using HTML entities or unusual schemes. Pay attention to how the editor sanitises content and whether it can be tricked into allowing dangerous markup.

    Seen in 4 reports
  4. Look for second-order XSS by submitting payloads through public forms that are reviewed in internal panels. Use a callback or a simple alert to detect execution when an admin views your submission. This is often overlooked and can lead to high-impact findings.

    Seen in 4 reports
  5. When testing stored XSS, always demonstrate impact. A simple alert box may be considered low impact; show that you can steal a session token, perform actions as the victim, or access sensitive data. Chain with other vulnerabilities like CSRF or IDOR to escalate.

    Seen in 3 reports
  6. Avoid reporting self-XSS unless you can show how it affects other users. Self-XSS occurs when the payload only executes in your own browser and requires you to paste it manually. Look for ways to make it stored and executed for others, such as combining with CSRF or social engineering.

    Seen in 3 reports
  7. Check if your payload is blocked by a content security policy (CSP). If so, look for bypasses such as injecting a base tag to load script from an allowed source, or using same-origin resources. CSP bypasses can turn a blocked XSS into a working exploit.

    Seen in 3 reports
  8. Pay attention to context: the same input may be safe in one place and dangerous in another. Test how your input is rendered in different parts of the application, such as in HTML attributes, JavaScript strings, or CSS. Use context-appropriate payloads to break out.

    Seen in 3 reports
  9. Look for stored XSS in unexpected places like error messages, log files, and email notifications. These are often overlooked and may not be properly sanitised.

    Seen in 3 reports
  10. If you find a filter, try to bypass it with encoding tricks, alternative syntax, or by exploiting parsing quirks. For example, some filters may not decode HTML entities before checking, or may be bypassed with unusual whitespace or control characters.

    Seen in 3 reports
  11. Remember that stored XSS can be chained with other vulnerabilities to increase impact. For example, combine with CSRF to force a victim to store a payload, or with SSRF to reach internal services. Think creatively about how to escalate.

    Seen in 2 reports
  12. Do not test on production systems without permission. Always stay within the program's scope and avoid actions that could disrupt services or affect real users. If you are unsure, ask the program first.

    Seen in 1 report
  13. Keep detailed notes and screenshots of each step, including the request and response, to help triagers understand the vulnerability. Clearly explain the impact and the conditions required for exploitation.

    Seen in 1 report
  14. Finally, always verify that your payload executes in a real browser and not just in a simulated environment. Use a browser with developer tools to confirm execution and capture evidence.

    Seen in 1 report