Skip to content
Fencer Vulns
high 7.1

CVE-2023-36823 json

Sanitize vulnerable to Cross-site Scripting via insufficient neutralization of `style` element content

published 2023-07-06 3 y ago modified 2026-06-17 4 mo ago also GHSA-f5ww-cq3m-q3g7 , EUVD-2023-2045

cvss
7.1
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.7%
EPSS 0.7% chance of exploitation in 30 days, percentile 53%
public exploits
0
none known

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.

Patch / fix

  • rubygems sanitize 6.0.2
  • sanitize_project sanitize 6.0.2
  • ruby-sanitize Debian 12 6.0.0-1.1+deb12u1
  • ruby-sanitize Debian 14, Debian 13 6.0.2-1

debian advisories DEBIAN-CVE-2023-36823

  • ruby-sanitize Ubuntu 20.04 LTS 4.6.6-2.1~0.20.04.2
  • ruby-sanitize Ubuntu 22.04 LTS 6.0.0-1ubuntu0.1

ubuntu advisories UBUNTU-CVE-2023-36823

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

Exploit prediction

0.71% chance of exploitation in the next 30 days, higher than 53% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 7.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
NVD 3.1 6.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
GitHub 3.1 7.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L

Affected packages

ecosystem package affected fixed in
rubygems sanitize
>=3.0.0, <6.0.2
6.0.2

Affected products

  • rgrove sanitize

Classification

Weakness
  • CWE-79 Improper Neutralization of Input During Web Page Generation

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.