# CVE-2023-23627: Sanitize vulnerable to Cross-site Scripting via Improper neutralization of \`noscript\` element

- Priority: **Routine**
- Reason: Not severe (CVSS 6.1, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2023-01-27 · Modified: 2025-03-10
- Aliases: UBUNTU-CVE-2023-23627, DEBIAN-CVE-2023-23627, GHSA-fw3g-2h3j-qmm7
- Record: https://cvemate.com/vulnerability/CVE-2023-23627 · JSON: https://cvemate.com/vulnerability/CVE-2023-23627/json

## Description

```text
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.
```

## Signals

- CVSS: 6.1 medium (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- EPSS: 0.56%, percentile 48.018%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- debian ruby-sanitize (Debian): \< 6.0.0-1.1
- ubuntu ruby-sanitize (Ubuntu): \< 4.6.6-2.1~0.20.04.2 \| \< 6.0.0-1ubuntu0.1
- RubyGems sanitize (RubyGems): ≥ 5.0.0, \< 6.0.1
- rgrove sanitize: ≥ 5.0.0, \< 6.0.1
- sanitize\_project sanitize: ≥ 5.0.0, \< 6.0.1

## References

- <https://github.com/rgrove/sanitize/security/advisories/GHSA-fw3g-2h3j-qmm7>
- <https://ubuntu.com/security/CVE-2023-23627>
- <https://github.com/rgrove/sanitize/commit/ec14265e530dc3fe31ce2ef773594d3a97778d22>
- <https://www.cve.org/CVERecord?id=CVE-2023-23627>
- <https://ubuntu.com/security/notices/USN-6748-1>
- <https://security-tracker.debian.org/tracker/CVE-2023-23627>
- <https://nvd.nist.gov/vuln/detail/CVE-2023-23627>
- <https://github.com/rgrove/sanitize>
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sanitize/CVE-2023-23627.yml>

---

Data as of 2026-12-05T07:24:12.207Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
