npm package
sanitize-html 0.1.2 vulnerabilities, and the version that fixes all of them
sanitize-html 0.1.2 has 9 known vulnerabilities (1 rated high or critical); 2.17.6 fixes all of them. 2.17.6 has 1 known vulnerability of its own, so upgrade to 2.18.1, which has none.
npm (opens in a new tab) describes it as “Clean up user-submitted HTML, preserving allowlisted elements and allowlisted attributes on a per-element basis”
- Known vulnerabilities
- 9
- 1 rated high or critical
- Released
- Sep 10, 2013
- Latest is 2.18.1
- Downloads last week
- 15
- Under 1% of sanitize-html downloads
- Licence
- MIT
- Pulls in
- 10 packages
- Resolved by deps.dev
What to upgrade to
2.18.1 is the closest release with no known vulnerabilities that we checked.
Newest 0.1.x release. Released Sep 19, 2013.
9 known vulnerabilities, worst rated warningFixes all 9 known vulnerabilities. Released Jul 10, 2026.
1 known vulnerability, worst rated warning2.18.1Upgrade to this
Latest release. Released Oct 14, 2026.
No known vulnerabilities
2.18.1 came out on Oct 14, 2026. A coding agent trained before then doesn’t know it exists, so it may suggest an older release. AI knowledge cutoff dates
Hand the fix to your coding agent
One task with the upgrade, the file to change and why. Paste it into Claude Code, Cursor or Codex.
Findings
- CriticalVulnerability
9 known vulnerabilities in sanitize-html 0.1.2
EPSS: top 21%1 rated high or critical. Most serious: CVE-2022-25887, Sanitize-html Vulnerable To REDoS Attacks. Upgrading to 2.17.6 fixes all of them.
- WarningOutdated
sanitize-html 0.1.2 is 2 major versions behind
Latest release is 2.18.1.
Every advisory for sanitize-html 0.1.2
Known exploited first (CISA KEV), then by how likely they are to be exploited (FIRST EPSS), then by severity. Each id links to its OSV.dev record.
WarningCVE-2021-26539 on OSV.dev (opens in a new tab)GHSA-rjqq-98f6-6j3rEPSS: top 21%
Improper Input Validation in sanitize-html
Fixed in 2.3.1. Published May 6, 2021.
WarningCVE-2021-26540 on OSV.dev (opens in a new tab)GHSA-mjxr-4v3x-q3m4EPSS: top 23%
Improper Input Validation in sanitize-html
Fixed in 2.3.2. Published May 6, 2021.
CriticalCVE-2022-25887 on OSV.dev (opens in a new tab)GHSA-cgfm-xwp7-2cvrEPSS: top 28%
Sanitize-html Vulnerable To REDoS Attacks
Fixed in 2.7.1. Published Aug 31, 2022.
WarningCVE-2017-16016 on OSV.dev (opens in a new tab)GHSA-xc6g-ggrc-qq4rEPSS: top 30%
Cross-Site Scripting in sanitize-html
Fixed in 1.11.4. Published Nov 9, 2018.
WarningCVE-2017-16017 on OSV.dev (opens in a new tab)GHSA-wg96-3933-j2w5EPSS: top 34%
Cross-Site Scripting in sanitize-html
Fixed in 1.2.3. Published Nov 9, 2018.
WarningCVE-2024-21501 on OSV.dev (opens in a new tab)GHSA-rm97-x556-q36hEPSS: top 38%
sanitize-html Information Exposure vulnerability
Fixed in 2.12.1. Published Feb 24, 2024.
WarningCVE-2016-1000237 on OSV.dev (opens in a new tab)GHSA-3j7m-hmh3-9jmpEPSS: top 43%
Cross-Site Scripting in sanitize-html
Fixed in 1.4.3. Published Apr 16, 2020.
WarningCVE-2026-63670 on OSV.dev (opens in a new tab)GHSA-jxwj-j7wr-gfrwEPSS: top 76%
ApostropheCMS: Mutation-XSS / allowedTags bypass via literal `</textarea/>` solidus close
Fixed in 2.17.6. Published Sep 3, 2026.
WarningCVE-2019-25225 on OSV.dev (opens in a new tab)GHSA-qhxp-v273-g94hEPSS: top 83%
sanitize-html is vulnerable to XSS through incomprehensive sanitization
Fixed in 2.0.0-beta. Published Sep 8, 2025.
Who is still on a vulnerable sanitize-html
49% of last week’s 11.8M sanitize-html downloads went to versions with known vulnerabilities.
From npm’s per-version download counts for the last 7 days, each version checked against OSV.dev. The versions checked cover over 99% of downloads.
Is sanitize-html the only one?
Paste a public GitHub repo or drop your package.json and see every vulnerable, end-of-life or deprecated dependency, with one fix task. Free, no sign-up.
How this page is checked
StackPrism asks OSV.dev which advisories affect exactly sanitize-html 0.1.2, merges duplicates filed under several ids, and ranks them with CISA’s Known Exploited Vulnerabilities list and FIRST EPSS. Release dates and deprecation come from deps.dev and npm. No AI writes this page: every sentence comes from that data, refreshed every few hours.
Last checked against npm, OSV.dev, deps.dev, CISA KEV and FIRST EPSS.