Test API docs for XSS

Cross-site scripting (XSS)Discovery

Written with a model's help from “I Almost Didn’t Report This XSS. The Maintainer Fixed More Than I Asked.” by Jegann on Jegan Nithi (Medium). Read the writeup before relying on it.

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 or title fields to a payload like "</script><script>alert(1)</script> and see if it is reflected in the page without proper escaping. If the payload is executed, it may indicate an XSS vulnerability. To confirm, test the payload in a real browser and verify that the script is executed. Also, run a control test with a normal description to ensure it's the payload doing the damage.

Follow #openapi or #xss for new tips like this one, on your notifications page and, if you choose, in a daily or weekly email.

Comments

No comments yet.