Quick answers
- Is CVE-2024-21501 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2024-21501 being exploited in the wild.
- How severe is CVE-2024-21501?
- Low severity, with a CVSS score of 3.1, published 24 February 2024.
- Which products and versions are affected?
- sanitize-html (npm) before 2.12.1.
- Is there a fix for CVE-2024-21501?
- A patch was published on 2024-02-22: Fix merged in PR #650 for version 2.12.1 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2024-21501 attacked?
- It is attacked over the network.
- Am I affected by CVE-2024-21501?
- Check whether you run sanitize-html (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
Technical details
sanitize-html versions before 2.12.1 fail to properly sanitize CSS in the style attribute when PostCSS processes source maps. An attacker can inject CSS that uses URL references or other techniques to enumerate local files and directory structures on the backend server. The vulnerability requires that (1) the style attribute is explicitly allowed in the sanitizer configuration, and (2) the application processes user-supplied HTML on a backend server rather than in a browser. Exploitation reveals filesystem paths and dependency information without authentication. The fix in version 2.12.1 ignores source maps during PostCSS processing to prevent this leak.
Affected products
- npm sanitize-html before 2.12.1
Identifiers
- CVE-2024-21501
- GHSA-rm97-x556-q36h
Timeline
- 2024-02-24: disclosed: GHSA-rm97-x556-q36h and CVE-2024-21501 published
- 2024-02-22: patched: Fix merged in PR #650 for version 2.12.1