CVE-2024-21501 is a medium-severity (CVSS 5.3) Information Exposure vulnerability in sanitize-html. A fix is available for sanitize-html — see the affected versions and patch details below.
sanitize-html Information Exposure vulnerability
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for CVE-2024-21501.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
sanitize-htmlnpmDescription
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, allowing enumeration of files in the system (including project dependencies). An attacker could exploit this vulnerability to gather details about the file system structure and dependencies of the targeted server.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | sanitize-html | all versions | 2.12.1npm install sanitize-html@2.12.1 |
Affected Products
sanitize-htmlapostrophecmsfedorafedoraprojectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for sanitize-html, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update sanitize-html to 2.12.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-21501 is resolved across your whole dependency graph.
Workarounds
Assume what was exposed is already known: rotate any credential, token or key that the affected component could return, restrict the endpoint to callers that genuinely need it, and strip sensitive fields from responses and error output at the boundary rather than relying on the client not to read them.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| multicluster engine for Kubernetes 2.4 for RHEL 8 | multicluster-engine/console-mce-rhel8:v2.4.5-25 | RHBA-2024:3555 |
| multicluster engine for Kubernetes 2.5 for RHEL 9 | multicluster-engine/console-mce-rhel9:v2.5.2-6 | RHBA-2024:1775 |
| Red Hat Advanced Cluster Management for Kubernetes 2.10 for RHEL 9 | rhacm2/console-rhel9:v2.10.1-3 | RHBA-2024:1793 |
| Red Hat Advanced Cluster Management for Kubernetes 2.9 for RHEL 8 | rhacm2/console-rhel8:v2.9.4-22 | RHBA-2024:3593 |
| Red Hat OpenShift Container Platform 4.15 | openshift4/ose-monitoring-plugin-rhel8:v4.15.0-202404031310.p0.ge8f7503.assembly.stream.el8 | RHSA-2024:1770 |
Frequently Asked Questions
Is CVE-2024-21501 in your dependencies?
Find it across npm, including transitive dependencies.