CVE-2024-21501
JavaScript vulnerability analysis and mitigation

Overview

Versions of the package sanitize-html before 2.12.1 are vulnerable to Information Exposure when used on the backend and with the style attribute allowed. The vulnerability was discovered in February 2024 and affects the sanitize-html package's file system information handling (Snyk Security). The vulnerability was assigned CVE-2024-21501 and has a CVSS v3.1 base score of 5.3 (Medium) (NVD).

Technical details

The vulnerability occurs when the sanitize-html package is used on the backend with the style attribute allowed. The issue allows enumeration of files in the system, including project dependencies, through differences in how the package processes existing versus non-existing files. When a file actually exists on the server and is not a valid source map, the style attribute is not received; otherwise, it is received (GitHub Gist).

Impact

An attacker could exploit this vulnerability to gather details about the file system structure and dependencies of the targeted server. This information disclosure could potentially be used for further targeted attacks by revealing sensitive information about the server's file system layout (NVD).

Mitigation and workarounds

The recommended mitigation is to upgrade sanitize-html to version 2.12.1 or higher, which includes a fix for this vulnerability. The fix prevents the information disclosure by ignoring source maps when processing with PostCSS (GitHub PR).

Community reactions

The vulnerability was responsibly disclosed and addressed by the maintainers of the sanitize-html package. The Apostrophe CMS team has released version 3.63.1 which includes the patched version of sanitize-html to address this security issue (Apostrophe Discussion).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-23744CRITICAL9.8
  • JavaScriptJavaScript
  • @mcpjam/inspector
NoYesJan 16, 2026
CVE-2026-23735HIGH8.7
  • JavaScriptJavaScript
  • graphql-modules
NoYesJan 16, 2026
GHSA-gw32-9rmw-qwwwHIGH8.4
  • JavaScriptJavaScript
  • svelte
NoYesJan 16, 2026
CVE-2026-23745HIGH8.2
  • JavaScriptJavaScript
  • tar
NoYesJan 16, 2026
GHSA-38cw-85xc-xr9xMEDIUM6.8
  • JavaScriptJavaScript
  • @veramo/data-store
NoYesJan 16, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management