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 malicious JavaScript code. Use a payload like <img src=x onerror=alert(1)> to test for XSS vulnerabilities. You can also use tools like grep to search for potential vulnerabilities in the code. For example, use grep -rnE "html:\s*true" src/ to find where raw HTML is enabled, and grep -rnE "v-html|innerHTML|set:html|dangerouslySetInnerHTML|\{@html" src/ to find where the HTML is written to the page.
Follow #api-security, #vitepress 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.