Sanitize vulnerable to Cross-site Scripting via insufficient neutralization of `style` element content
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
Sanitize is an allowlist-based HTML and CSS sanitizer. Using carefully crafted input, an attacker may be able to sneak arbitrary HTML and CSS through Sanitize starting with version 3.0.0 and prior to version 6.0.2 when Sanitize is configured to use the built-in "relaxed" config or when using a custom config that allows `style` elements and one or more CSS at-rules. This could result in cross-site scripting or other undesired behavior when the malicious HTML and CSS are rendered in a browser. Sanitize 6.0.2 performs additional escaping of CSS in `style` element content, which fixes this issue. Users who are unable to upgrade can prevent this issue by using a Sanitize config that doesn't allow `style` elements, using a Sanitize config that doesn't allow CSS at-rules, or by manually escaping the character sequence `</` as `<\/` in `style` element content.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| rgrove | sanitize | 3.0.0 to before 6.0.2 | 6.0.2 | Patch available | CNA |
| — | sanitize (RubyGems) | 3.0.0 to before 6.0.2 | 6.0.2 | Patch available | GHSA-f5ww-cq3m-q3g7 |
- sanitize Vendorrgrove Affected 3.0.0 to before 6.0.2 Fixed in 6.0.2 Patch available CNA
- sanitize (RubyGems) Vendor— Affected 3.0.0 to before 6.0.2 Fixed in 6.0.2 Patch available GHSA-f5ww-cq3m-q3g7
Remediation
- Fix · CNA sanitize (rgrove) Fixed in 6.0.2
- Fix · GHSA-f5ww-cq3m-q3g7 sanitize (RubyGems) Fixed in 6.0.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2023-36823
- 2026-10-03 Alias added: GHSA-f5ww-cq3m-q3g7
References
Advisory 2
More rgrove Sanitize vulnerabilities
- TI-2020-03543 Cross-site Scripting in Sanitize CVSS 3.1HIGH 7.3
- TI-2018-02737 Cross-site scripting in Ryan Grove sanitize CVSS 3.0HIGH 7.5
- TI-2023-09456 Sanitize vulnerable to Cross-site Scripting via Improper neutralization of `noscript` element CVSS 3.1MEDIUM 6.1
Sources
- CVE-2023-36823 · CVE Program
- CVE-2023-36823 · NVD
- FIRST EPSS
- GHSA-f5ww-cq3m-q3g7 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences