Cross-site Scripting (XSS) Affecting ruby-sanitize package, versions <6.0.2-1


Severity

Recommended
0.0
medium
0
10

Snyk's Security Team recommends NVD's CVSS assessment. Learn more

Threat Intelligence

EPSS
0.71% (55th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-ECHOLATEST-RUBYSANITIZE-22587918
  • published18 Nov 2026
  • disclosed6 Jul 2023

Introduced: 6 Jul 2023

CVE-2023-36823  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

Upgrade Echo:latest ruby-sanitize to version 6.0.2-1 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream ruby-sanitize package and not the ruby-sanitize package as distributed by Echo. See How to fix? for Echo:latest relevant fixed versions and status.

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 &lt;/ as &lt;\/ in style element content.

CVSS Base Scores

version 3.1