What’s Vulnerable › Vulnerabilities
CVE-2023-23627: Sanitize vulnerable to Cross-site Scripting via Improper neutralization of `noscript` element
- Severity: medium (CVSS 6.1 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.5% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2023-01-28 · updated 2026-06-17
- Weakness: CWE-79
Description
Sanitize is an allowlist-based HTML and CSS sanitizer. Versions 5.0.0 and later, prior to 6.0.1, are vulnerable to Cross-site Scripting. When Sanitize is configured with a custom allowlist that allows `noscript` elements, attackers are able to include arbitrary HTML, resulting in XSS (cross-site scripting) or other undesired behavior when that HTML is rendered in a browser. The default configurations do not allow `noscript` elements and are not vulnerable. This issue only affects users who are using a custom config that adds `noscript` to the element allowlist. This issue has been patched in version 6.0.1. Users who are unable to upgrade can prevent this issue by using one of Sanitize's default configs or by ensuring that their custom config does not include `noscript` in the element allowlist.
Affected products
- rgrove sanitize: from 5.0.0 before 6.0.1 — fixed in 6.0.1
- Rubygems Sanitize: from 5.0.0 before 6.0.1; 5.0.0, 5.1.0, 5.2.0, 5.2.1, 5.2.2, 5.2.3 (+1) — fixed in 6.0.1
How to fix
Upgrade to a fixed version: rgrove sanitize 6.0.1; Rubygems Sanitize 6.0.1. Check the vendor advisory for mitigations.
References
- https://github.com/rgrove/sanitize/security/advisories/GHSA-fw3g-2h3j-qmm7
- https://github.com/rgrove/sanitize/security/advisories/GHSA-fw3g-2h3j-qmm7
Get alerted when CVE-2023-23627 or the next vulnerability affects your stack