# CVE-2024-32468: Improper neutralization of input during web page generation ("Cross-site Scripting") in deno_doc HTML generator

> Cross-site scripting in deno_doc allows code execution when generating HTML documentation from malicious input.

- **Severity:** Medium 5.4 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 25 Nov 2024
- **Updated:** 25 Nov 2024
- **Also known as:** GHSA-qqwr-j9mm-fhw6

## What is CVE-2024-32468?

CVE-2024-32468 is a medium-severity cross-site scripting vulnerability in denoland deno, published on 25 Nov 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

Deno is a runtime for JavaScript and TypeScript written in rust. Several cross-site scripting vulnerabilities existed in the `deno_doc` crate which lead to Self-XSS with deno doc --html. 1.) XSS in generated `search_index.js`, `deno_doc` outputs a JavaScript file for searching. However, the generated file used `innerHTML` on unsanitzed HTML input. 2.) XSS via property, method and enum names, `deno_doc` did not sanitize property names, method names and enum names. The first XSS most likely didn't have an impact since `deno doc --html` is expected to be used locally with own packages.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2024-32468?

2 open source packages ship an affected version, including deno_doc.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `deno_doc` | crates.io | All versions | 0.119.0 |
| `deno_doc` | crates.io | All versions | 0.119.0 |

## How do I fix CVE-2024-32468?

Upgrade deno_doc to 0.119.0 or later.

## Is CVE-2024-32468 being exploited?

There is no known exploitation of CVE-2024-32468 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-32468 and fix it if it is affected.

What it is: CVE-2024-32468 is a medium-severity cross-site scripting vulnerability in denoland deno, published on 25 Nov 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-32468 in the wild and no public exploit code.

Affected packages and fixed versions:
- deno_doc (crates.io): affected all versions; fixed in 0.119.0
- deno_doc (crates.io): affected all versions; fixed in 0.119.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-32468/ (Markdown: https://insights.sbomify.com/CVE-2024-32468/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-32468
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-32468
- OSV: https://osv.dev/vulnerability/CVE-2024-32468

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-32468/
Summaries are generated and may contain mistakes; the official description above is the record.
