Skip to content

Improper neutralization of input during web page generation ("Cross-site Scripting") in deno_doc HTML generator

Moderate
bartlomieju published GHSA-qqwr-j9mm-fhw6 Nov 25, 2024

Package

deno

Affected versions

<1.42.0

Patched versions

1.42.0
cargo deno_doc (Rust)
<0.119.0
0.119.0

Description

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.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

CVE ID

CVE-2024-32468

Weaknesses

Credits