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

- Severity: Medium 6.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.57%, higher than 41% of CVEs (2026-11-30)
- Published: 2023-01-27T23:44:17.617Z
- Modified: 2026-06-17T05:37:37.137Z
- Also known as: GHSA-fw3g-2h3j-qmm7
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- rgrove sanitize: >= 5.0.0, < 6.0.1
- sanitize (RubyGems): from 5.0.0 before 6.0.1
- sanitize_project sanitize: from 5.0.0 before 6.0.1

## Every score

- GitHub_M: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/rgrove/sanitize/security/advisories/GHSA-fw3g-2h3j-qmm7> (mitigation, release-notes, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-23627> (advisory)
- <https://github.com/rgrove/sanitize/commit/ec14265e530dc3fe31ce2ef773594d3a97778d22> (web)
- <https://github.com/rgrove/sanitize> (package)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sanitize/CVE-2023-23627.yml> (web)

## Sources

- CVE List: [CVE-2023-23627](https://www.cve.org/CVERecord?id=CVE-2023-23627), CVE Terms of Use, modified 2025-03-10
- GitHub Advisory Database: [GHSA-fw3g-2h3j-qmm7](https://github.com/advisories/GHSA-fw3g-2h3j-qmm7), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2023-23627](https://nvd.nist.gov/vuln/detail/CVE-2023-23627), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-23627 · Whole record: https://cve.day/CVE-2023-23627.json · Rebuilt by cve.day 2026-11-25T22:58:21.764Z
