Track vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
6.1

CVE-2022-23520: rails-html-sanitizer could allow injected content

CVE-2022-23520 · published 3 years ago
Summary

If a Rails application changes the list of tags that the sanitizer accepts and includes both the "select" and "style" tags, an attacker could insert harmful code into web pages. This risk is fixed in version 1.4.4 of rails-html-sanitizer. Update to the newer version or remove either the "select" or "style" tag from the custom list to stay safe.

What to do
  • Update rafael mendonça frança rails-html-sanitizer to version 1.4.4.
  • Update debian ruby-rails-html-sanitizer to version 1.4.4-1.
  • Update rubyonrails rails_html_sanitizers to version 1.4.4 or later.
Affected software
Ecosystem VendorProductAffected versions
rubygems rafael mendonça frança rails-html-sanitizer < 1.4.4
Fix: upgrade to 1.4.4
– rubyonrails rails_html_sanitizers < 1.4.4
cpe:2.3:a:rubyonrails:rails_html_sanitizers:*:*:*:*:*:rails:*:*
– debian debian_linux 10.0
cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*
Ubuntu:16.04:LTS canonical ruby-rails-html-sanitizer All versions
Debian:12 debian ruby-rails-html-sanitizer < 1.4.4-1
Fix: upgrade to 1.4.4-1
Original advisory text
rails-html-sanitizer contains an incomplete fix for an XSS vulnerability
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.
Fix within
Internet-facing 60 days
Internal At next upgrade
  • Not known to be exploited
  • Needs hands-on effort to exploit (estimated)
  • Gives an attacker partial control (estimated)
Severity
6.1 Medium
Exploitation
1% chance of attack within 30 days
Type
CWE-79Cross-site Scripting (XSS)
Timeline
Published14 Dec 2022
Updated4 Nov 2026
First seen6 Mar 2026
Track software like this
Free during beta