# CVE-2023-36823: Sanitize vulnerable to Cross-site Scripting via insufficient neutralization of `style` element content

- Severity: High 7.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:L`
- 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.71%, higher than 54% of CVEs (2026-12-01)
- Published: 2023-07-06T15:06:00.509Z
- Modified: 2026-06-17T06:07:09.173Z
- Also known as: GHSA-f5ww-cq3m-q3g7
- Weaknesses: CWE-79
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- rgrove sanitize: >= 3.0.0, < 6.0.2
- sanitize (RubyGems): from 3.0.0 before 6.0.2
- sanitize_project sanitize: from 3.0.0 before 6.0.2
- debian debian_linux: 10.0

## Every score

- GitHub_M: CVSS:3.1 7.1 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L`
- GitHub: CVSS:3.1 7.1 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L`
- 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-f5ww-cq3m-q3g7> (vendor-advisory, web)
- <https://github.com/rgrove/sanitize/commit/76ed46e6dc70820f38efe27de8dabd54dddb5220> (patch, web)
- <https://github.com/rgrove/sanitize/releases/tag/v6.0.2> (release-notes, web)
- <https://lists.debian.org/debian-lts-announce/2023/11/msg00008.html> (mailing-list, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-36823> (advisory)
- <https://github.com/rgrove/sanitize> (package)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sanitize/CVE-2023-36823.yml> (web)

## Sources

- CVE List: [CVE-2023-36823](https://www.cve.org/CVERecord?id=CVE-2023-36823), CVE Terms of Use, modified 2025-02-13
- GitHub Advisory Database: [GHSA-f5ww-cq3m-q3g7](https://github.com/advisories/GHSA-f5ww-cq3m-q3g7), CC-BY-4.0, modified 2024-02-16
- NVD: [CVE-2023-36823](https://nvd.nist.gov/vuln/detail/CVE-2023-36823), Public domain, modified 2026-06-17

---

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