npm package
sanitize-html 2.2.0 vulnerabilities, and the version that fixes all of them
sanitize-html 2.2.0 has 7 known vulnerabilities (1 rated high or critical); 2.17.7 fixes all of them.
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
- 7
- 1 rated high or critical
- Released
- Dec 2, 2020
- Latest is 2.18.1
- Downloads last week
- 184
- Under 1% of sanitize-html downloads
- Licence
- MIT
- Pulls in
- 17 packages
- Resolved by deps.dev
What to upgrade to
2.17.7 is the closest release with no known vulnerabilities.
2.17.7Upgrade to this
Fixes all 7 known vulnerabilities. Released Aug 13, 2026.
No known vulnerabilitiesNewest 2.x release and the latest release. Released Oct 14, 2026.
No known vulnerabilities
2.17.7 came out on Aug 13, 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
7 known vulnerabilities in sanitize-html 2.2.0
EPSS: top 21%1 rated high or critical. Most serious: CVE-2022-25887, Sanitize-html Vulnerable To REDoS Attacks. Upgrading to 2.17.7 fixes all of them.
- LowOutdated
sanitize-html 2.2.0 is a minor version behind
Latest release is 2.18.1.
Every advisory for sanitize-html 2.2.0
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-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-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-2026-84371 on OSV.dev (opens in a new tab)GHSA-g8qq-57p8-ggw5EPSS: top 79%
ApostropheCMS: Stored XSS via SVG SMIL URI-list scheme-policy bypass
Fixed in 2.17.7. Published Sep 1, 2026.
WarningCVE-2026-53606 on OSV.dev (opens in a new tab)GHSA-vccv-cmxp-4j9hEPSS: top 88%
sanitize-html has incomplete URI scheme validation in that allows javascript: URIs through action, formaction, data, poster, and background attributes
Fixed in 2.17.5. Published Jul 31, 2026.
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 2.2.0, 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.