npm package
sanitize-html
pkg:npm/sanitize-html
Vulnerabilities (9)
| CVE | Sev | CVSS | KEV | Affected versions | Fixed in | Published | Description |
|---|---|---|---|---|---|---|---|
| CVE-2026-40186 | Med | 6.1 | >= 2.17.2, < 2.17.3 | 2.17.3 | Apr 15, 2026 | ApostropheCMS is an open-source Node.js content management system. A regression introduced in commit 49d0bb7, included in versions 2.17.1 of the ApostropheCMS-maintained sanitize-html package bypasses allowedTags enforcement for text inside nonTextTagsArray elements (textarea and | |
| CVE-2019-25225 | — | < 2.0.0-beta | 2.0.0-beta | Sep 8, 2025 | `sanitize-html` prior to version 2.0.0-beta is vulnerable to Cross-site Scripting (XSS). The `sanitizeHtml()` function in `index.js` does not sanitize content when using the custom `transformTags` option, which is intended to convert attribute values into text. As a result, malic | ||
| CVE-2024-21501 | — | < 2.12.1 | 2.12.1 | Feb 24, 2024 | 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 | ||
| CVE-2022-25887 | — | < 2.7.1 | 2.7.1 | Aug 30, 2022 | The package sanitize-html before 2.7.1 are vulnerable to Regular Expression Denial of Service (ReDoS) due to insecure global regular expression replacement logic of HTML comment removal. | ||
| CVE-2021-26540 | — | < 2.3.2 | 2.3.2 | Feb 8, 2021 | Apostrophe Technologies sanitize-html before 2.3.2 does not properly validate the hostnames set by the "allowedIframeHostnames" option when the "allowIframeRelativeUrls" is set to true, which allows attackers to bypass hostname whitelist for iframe element, related using an src v | ||
| CVE-2021-26539 | — | < 2.3.1 | 2.3.1 | Feb 8, 2021 | Apostrophe Technologies sanitize-html before 2.3.1 does not properly handle internationalized domain name (IDN) which could allow an attacker to bypass hostname whitelist validation set by the "allowedIframeHostnames" option. | ||
| CVE-2016-1000237 | — | < 1.4.3 | 1.4.3 | Jan 23, 2020 | sanitize-html before 1.4.3 has XSS. | ||
| CVE-2017-16017 | — | < 1.2.3 | 1.2.3 | Jun 4, 2018 | sanitize-html is a library for scrubbing html input for malicious values Versions 1.2.2 and below have a cross site scripting vulnerability. | ||
| CVE-2017-16016 | — | < 1.11.4 | 1.11.4 | Jun 4, 2018 | Sanitize-html is a library for scrubbing html input of malicious values. Versions 1.11.1 and below are vulnerable to cross site scripting (XSS) in certain scenarios: If allowed at least one nonTextTags, the result is a potential XSS vulnerability. |
- affected >= 2.17.2, < 2.17.3fixed 2.17.3
ApostropheCMS is an open-source Node.js content management system. A regression introduced in commit 49d0bb7, included in versions 2.17.1 of the ApostropheCMS-maintained sanitize-html package bypasses allowedTags enforcement for text inside nonTextTagsArray elements (textarea and
- CVE-2019-25225Sep 8, 2025affected < 2.0.0-betafixed 2.0.0-beta
`sanitize-html` prior to version 2.0.0-beta is vulnerable to Cross-site Scripting (XSS). The `sanitizeHtml()` function in `index.js` does not sanitize content when using the custom `transformTags` option, which is intended to convert attribute values into text. As a result, malic
- CVE-2024-21501Feb 24, 2024affected < 2.12.1fixed 2.12.1
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
- CVE-2022-25887Aug 30, 2022affected < 2.7.1fixed 2.7.1
The package sanitize-html before 2.7.1 are vulnerable to Regular Expression Denial of Service (ReDoS) due to insecure global regular expression replacement logic of HTML comment removal.
- CVE-2021-26540Feb 8, 2021affected < 2.3.2fixed 2.3.2
Apostrophe Technologies sanitize-html before 2.3.2 does not properly validate the hostnames set by the "allowedIframeHostnames" option when the "allowIframeRelativeUrls" is set to true, which allows attackers to bypass hostname whitelist for iframe element, related using an src v
- CVE-2021-26539Feb 8, 2021affected < 2.3.1fixed 2.3.1
Apostrophe Technologies sanitize-html before 2.3.1 does not properly handle internationalized domain name (IDN) which could allow an attacker to bypass hostname whitelist validation set by the "allowedIframeHostnames" option.
- CVE-2016-1000237Jan 23, 2020affected < 1.4.3fixed 1.4.3
sanitize-html before 1.4.3 has XSS.
- CVE-2017-16017Jun 4, 2018affected < 1.2.3fixed 1.2.3
sanitize-html is a library for scrubbing html input for malicious values Versions 1.2.2 and below have a cross site scripting vulnerability.
- CVE-2017-16016Jun 4, 2018affected < 1.11.4fixed 1.11.4
Sanitize-html is a library for scrubbing html input of malicious values. Versions 1.11.1 and below are vulnerable to cross site scripting (XSS) in certain scenarios: If allowed at least one nonTextTags, the result is a potential XSS vulnerability.