GitHub Advisoryadvisory · RubyGems

GHSA-f5ww-cq3m-q3g7 Sanitize vulnerable to Cross-site Scripting via insufficient neutralization of `style` element content

HIGH Published 2023-07-06 Modified 2023-07-06 Official page ↗
Aliases
CVE-2023-36823
Ecosystem
RubyGems
Packages
sanitize
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
Weaknesses
CWE-79
Reviewed
2023-07-06

Affected packages

• RubyGems sanitize: >= 3.0.0, < 6.0.2 → fixed in 6.0.2

Description

Impact Using carefully crafted input, an attacker may be able to sneak arbitrary HTML and CSS through Sanitize `>= 3.0.0, = 6.0.2` performs additional escaping of CSS in `style` element content, which fixes this issue. Workarounds 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. Credit This issue was found by @cure53 during an audit of a project that uses Sanitize and was reported by one of that project's maintainers. Thank you!

Related

Alias · CVE (1)

  • CVE-2023-36823 Sanitize is an allowlist-based HTML and CSS sanitizer. vulnerability

Weakness · CWE (1)

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

References