@docsearch/js is vulnerable to Cross-Site Scripting (XSS)
61
Medium Risk
The package bundles the DocSearch React UI, whose Ask AI feature renders assistant-generated markdown answers as HTML. Before the fix, answer text was converted to HTML with marked and injected through dangerouslySetInnerHTML without sanitization, so raw HTML tags and unsafe link schemes in the answer were rendered verbatim. Content that reaches the assistant response, such as poisoned indexed documentation, can execute arbitrary JavaScript in the browser of a user viewing the answer. The fix routes markdown through a sanitizing pipeline that escapes raw HTML, allowlists code-fence language identifiers, and blocks unsafe URL schemes.
You are affected if you are using a version that falls within the vulnerable range and you have the Ask AI feature enabled.
@docsearch/js is vulnerable to Cross-Site Scripting (XSS) in versions 4.0.0 - 4.6.3.
Upgrade the @docsearch/js library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant