Vulnerability · Published Dec 14, 2022 · Assigned by GitHub_M
CVE-2022-23520rails-html-sanitizer contains an incomplete fix for an XSS vulnerability
Medium 6.1
In plain English
A medium-severity cross-site scripting in rails-html-sanitizer from rails. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.2% (higher than 68% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Prior to version 1.4.4, there is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer due to an incomplete fix of CVE-2022-32209. Rails::Html::Sanitizer may allow an attacker to inject content if the application developer has overridden the sanitizer's allowed tags to allow both "select" and "style" elements. Code is only impacted if allowed tags are being overridden. This issue is patched in version 1.4.4. All users overriding the allowed tags to include both "select" and "style" should either upgrade or use this workaround: Remove either "select" or "style" from the overridden allowed tags. NOTE: Code is _not_ impacted if allowed tags are overridden using either the :tags option to the Action View helper method sanitize or the :tags option to the instance method SafeListSanitizer#sanitize.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | ruby-rails-html-sanitizer | 1.4.4-1 | DEBIAN-CVE-2022-23520 |
| Debian:13 | ruby-rails-html-sanitizer | 1.4.4-1 | DEBIAN-CVE-2022-23520 |
| Debian:14 | ruby-rails-html-sanitizer | 1.4.4-1 | DEBIAN-CVE-2022-23520 |
| RubyGems | rails-html-sanitizer | 1.4.4 | GHSA-rrfc-7g8p-99q8 |
| Ubuntu:22.04:LTS | ruby-rails-html-sanitizer | no fix listed | UBUNTU-CVE-2022-23520 |
| Ubuntu:24.04:LTS | ruby-rails-html-sanitizer | no fix listed | UBUNTU-CVE-2022-23520 |
| Ubuntu:25.10 | ruby-rails-html-sanitizer | no fix listed | UBUNTU-CVE-2022-23520 |
| Ubuntu:26.04:LTS | ruby-rails-html-sanitizer | no fix listed | UBUNTU-CVE-2022-23520 |
| Ubuntu:26.10 | ruby-rails-html-sanitizer | no fix listed | UBUNTU-CVE-2022-23520 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| rails | rails-html-sanitizer | < 1.4.4 |
Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N