GitHub Advisoryadvisory · RubyGems
GHSA-f5ww-cq3m-q3g7 Sanitize vulnerable to Cross-site Scripting via insufficient neutralization of `style` element content
HIGH
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
- https://github.com/rgrove/sanitize/security/advisories/GHSA-f5ww-cq3m-q3g7 web
- https://nvd.nist.gov/vuln/detail/CVE-2023-36823 advisory
- https://github.com/rgrove/sanitize/commit/76ed46e6dc70820f38efe27de8dabd54dddb5220 web
- https://github.com/rgrove/sanitize package
- https://github.com/rgrove/sanitize/releases/tag/v6.0.2 web
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sanitize/CVE-2023-36823.yml web
- https://lists.debian.org/debian-lts-announce/2023/11/msg00008.html web