CVE-2023-36823
published high CVSS 3.1 · 7.1Sanitize vulnerable to Cross-site Scripting via insufficient neutralization of `style` element content
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| rgrove | — | sanitize>= 3.0.0, < 6.0.2 | Affected | Not stated | GitHub_M |
| Debian | bookworm | ruby-sanitize | Advisory build | 6.0.0-1.1+deb12u1 | DSA-5616-1 |
| Ubuntu | focal | ruby-sanitize | Advisory build | 4.6.6-2.1~0.20.04.2 | USN-6748-1 |
| Debian | bullseye | ruby-sanitize | Advisory build | 5.2.1-2+deb11u1 | DSA-5616-1 |
| Debian | buster | ruby-sanitize | Advisory build | 4.6.6-2.1~deb10u2 | DLA-3652-1 |
| Ubuntu | jammy | ruby-sanitize | Advisory build | 6.0.0-1ubuntu0.1 | USN-6748-1 |
Description
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.1 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| rgrove | sanitize | >= 3.0.0, < 6.0.2 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-79 CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
References
4Provider assertions
2GitHub_M · cna
Sanitize vulnerable to Cross-site Scripting via insufficient neutralization of `style` element content
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- c4d37b59a951a0a7b16f842079919591d4140bc12679c9c2c41db823c39775f6
- Ingested
- 23 Sep 2026, 08:10:01 UTC
- Source record
- Official CVE record