CVE-2022-32209 Rails::Html::Sanitizer vulnerable to Cross-site Scripting
- Published
- Updated
- Exploit status
- Proof-of-concept only
- Technology
- UbuntuDebian
Description
Possible XSS Vulnerability in Rails::Html::SanitizerThere is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer.This vulnerability has been assigned the CVE identifier CVE-2022-32209.Versions Affected: ALLNot affected: NONEFixed Versions: v1.4.3## ImpactA possible XSS vulnerability with certain configurations of 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 may be done via application configuration:ruby# In config/application.rbconfig.action_view.sanitized_allowed_tags = ["select", "style"]see https://guides.rubyonrails.org/configuring.html#configuring-action-viewOr it may be done with a :tags option to the Action View helper sanitize:<%= sanitize @comment.body, tags: ["select", "style"] %>see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitizeOr it may be done with Rails::Html::SafeListSanitizer directly:ruby# class-level optionRails::Html::SafeListSanitizer.allowed_tags = ["select", "style"]orruby# instance-level optionRails::Html::SafeListSanitizer.new.sanitize(@article.body, tags: ["select", "style"])All users overriding the allowed tags by any of the above mechanisms to include both "select" and "style" should either upgrade or use one of the workarounds immediately.## ReleasesThe FIXED releases are available at the normal locations.## WorkaroundsRemove either select or style from the overridden allowed tags.## CreditsThis vulnerability was responsibly reported by windshock.
Upgrade path
11 packages: 5 fixed, 4 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| ubuntu/ruby-rails-html-sanitizer(Ubuntu 16.04) | = 1.0.2-1; = 1.0.3-1; = 1.0.3-2; All versions | No fix listed | No fix yet |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu 18.04) | = 1.0.3-2; = 1.0.4-1; All versions | No fix listed | No fix yet |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu 20.04) | = 1.0.4-1; = 1.3.0-1; All versions | No fix listed | No fix yet |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu 22.04) | = 1.3.0-2; = 1.4.2-1; = 1.4.2-2; All versions | No fix listed | No fix yet |
| debian/ruby-rails-html-sanitizer(Debian 12) | < 1.4.3-0.1 | 1.4.3-0.1 | Fixed |
| debian/ruby-rails-html-sanitizer(Debian 13) | < 1.4.3-0.1 | 1.4.3-0.1 | Fixed |
| debian/ruby-rails-html-sanitizer(Debian 14) | < 1.4.3-0.1 | 1.4.3-0.1 | Fixed |
| rubygems rails-html-sanitizer(RubyGems) | < 1.4.3; = 1.0.0; = 1.0.1; = 1.0.2 +8 more | 1.4.3 | Fixed |
| rubyonrails rails html sanitizers | < 1.4.3 | 1.4.3 | Fixed |
| debian linux | = 10.0 | No fix listed | Versions listed |
| fedoraproject fedora | = 35; = 36 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| rubygems rails-html-sanitizer(RubyGems) | < 1.4.3 | 1.4.3 |
| rubygems rails-html-sanitizer(RubyGems) | = 1.0.0 | No fix listed |
| rubygems rails-html-sanitizer(RubyGems) | = 1.0.1 | No fix listed |
| rubygems rails-html-sanitizer(RubyGems) | = 1.0.2 | No fix listed |
| rubygems rails-html-sanitizer(RubyGems) | = 1.0.3 | No fix listed |
| rubygems rails-html-sanitizer(RubyGems) | = 1.0.4 | No fix listed |
| rubygems rails-html-sanitizer(RubyGems) | = 1.1.0 | No fix listed |
| rubygems rails-html-sanitizer(RubyGems) | = 1.2.0 | No fix listed |
| rubygems rails-html-sanitizer(RubyGems) | = 1.3.0 | No fix listed |
| rubygems rails-html-sanitizer(RubyGems) | = 1.4.0 | No fix listed |
| rubygems rails-html-sanitizer(RubyGems) | = 1.4.1 | No fix listed |
| rubygems rails-html-sanitizer(RubyGems) | = 1.4.2 | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:22.04) | All versions | No fix listed |
| rubyonrails rails html sanitizers | < 1.4.3 | 1.4.3 |
| fedoraproject fedora | = 35 | No fix listed |
| fedoraproject fedora | = 36 | No fix listed |
| debian linux | = 10.0 | No fix listed |
| debian/ruby-rails-html-sanitizer(Debian:12) | < 1.4.3-0.1 | 1.4.3-0.1 |
| debian/ruby-rails-html-sanitizer(Debian:14) | < 1.4.3-0.1 | 1.4.3-0.1 |
| debian/ruby-rails-html-sanitizer(Debian:13) | < 1.4.3-0.1 | 1.4.3-0.1 |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:16.04) | All versions | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:16.04) | = 1.0.2-1 | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:16.04) | = 1.0.3-1 | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:16.04) | = 1.0.3-2 | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:18.04) | All versions | No fix listed |
Show 8 more
| Product | Affected versions | Fixed in |
|---|---|---|
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:18.04) | = 1.0.3-2 | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:18.04) | = 1.0.4-1 | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:20.04) | All versions | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:20.04) | = 1.0.4-1 | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:20.04) | = 1.3.0-1 | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:22.04) | = 1.3.0-2 | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:22.04) | = 1.4.2-1 | No fix listed |
| ubuntu/ruby-rails-html-sanitizer(Ubuntu:22.04) | = 1.4.2-2 | No fix listed |
References
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com issue-tracking patch
- hackerone.com exploit issue-tracking third-party-advisory
- github.com product
- github.com exploit
- groups.google.com
- [debian-lts-announce] 20221206 [SECURITY] [DLA 3227-1] ruby-rails-html-sanitizer security update mailing-list third-party-advisory
- lists.debian.org
- FEDORA-2022-ce4719993c mailing-list third-party-advisory vendor-advisory
- FEDORA-2022-974fffb418 mailing-list third-party-advisory vendor-advisory
- lists.fedoraproject.org
- lists.fedoraproject.org
- Debian Security Tracker CVE-2022-32209 vendor-advisory
- github.com
- Ubuntu CVE tracker issue-tracking vendor-advisory
- www.cve.org issue-tracking
- bugs.debian.org issue-tracking
- discuss.rubyonrails.org issue-tracking