GHSA-qqwr-j9mm-fhw6
deno_doc's HTML generator vulnerable to Cross-site Scripting
Packages
Details
As written in the advisory (Markdown source, shown as plain text).
### Summary
Several cross-site scripting vulnerabilities existed in the `deno_doc` crate which lead to Self-XSS with `deno doc --html`.
### Details & PoC
1.) XSS in generated `search_index.js`
`deno_doc` outputed a JavaScript file for searching. However, the generated file used `innerHTML` on unsanitzed HTML input.
https://github.com/denoland/deno_doc/blob/dc556c848831d7ae48f3eff2ababc6e75eb6b73e/src/html/templates/pages/search.js#L120-L144
2.) XSS via property, method and enum names
`deno_doc` did not sanitize property names, method names and enum names.
### Impact
The first XSS most likely didn't have an impact since `deno doc --html` is expected to be used locally with own packages.
References
External links from the advisory. They lead to third-party sites.
- https://github.com/denoland/deno/security/advisories/GHSA-qqwr-j9mm-fhw6
- https://nvd.nist.gov/vuln/detail/CVE-2024-32468
- https://github.com/denoland/deno_doc/commit/0f1ef3efbf16194730a29d93dcb9c02f6c490942
- https://github.com/denoland/deno
- https://github.com/denoland/deno_doc/blob/dc556c848831d7ae48f3eff2ababc6e75eb6b73e/src/html/templates/pages/search.js#L120-L144