CVE-2022-32209
rubygem-rails-html-sanitizer: possible xss with certain configurations
Overview
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.
Source: OX vulnerability database
Severity
6.1 · MEDIUM
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Changed
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Weakness: CWE-79
Affected packages · 1
| Ecosystem | Package | Vulnerable | Fixed in |
|---|---|---|---|
| RubyGems | rails-html-sanitizer | <1.4.3 | 1.4.3 |
Open a package to see all its vulnerabilities.
Operating systems · 13 fixes
Red Hat 1 release · 1 package
affected 1
rubygem-rails-html-sanitizer
| Release | Package | Fixed in |
|---|---|---|
| 7 | rubygem-rails-html-sanitizer | affected |
SUSE Linux Enterprise 1 release · 1 package
fixed 1
ruby2-5-rubygem-rails-html-sanitizer
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.4 | ruby2-5-rubygem-rails-html-sanitizer | 1.0.4-150000.4.3.1 | SUSE-SU-2022:2870-1 |
debian 5 releases · 1 package
fixed 5
ruby-rails-html-sanitizer
| Release | Package | Fixed in |
|---|---|---|
| 10 | ruby-rails-html-sanitizer | 1.0.4-1+deb10u1 |
| 11 | ruby-rails-html-sanitizer | 1.3.0-1+deb11u1 |
| 12 | ruby-rails-html-sanitizer | 1.4.3-0.1 |
| 13 | ruby-rails-html-sanitizer | 1.4.3-0.1 |
| 14 | ruby-rails-html-sanitizer | 1.4.3-0.1 |
echo 1 release · 1 package
fixed 1
ruby-rails-html-sanitizer
| Release | Package | Fixed in |
|---|---|---|
| ruby-rails-html-sanitizer | 1.4.3-0.1 |
openSUSE 1 release · 5 packages
fixed 5
ruby3-1-rubygem-rails-html-sanitizer
ruby3-2-rubygem-rails-html-sanitizer
ruby3-3-rubygem-rails-html-sanitizer
ruby3-4-rubygem-rails-html-sanitizer
ruby4-0-rubygem-rails-html-sanitizer
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Tumbleweed | ruby3-1-rubygem-rails-html-sanitizer | 1.4.3-1.1 | openSUSE-SU-2024:12145-1 |
| Tumbleweed | ruby3-2-rubygem-rails-html-sanitizer | 1.5.0-2.1 | openSUSE-SU-2024:13137-1 |
| Tumbleweed | ruby3-3-rubygem-rails-html-sanitizer | 1.6.0-1.5 | openSUSE-SU-2024:14175-1 |
| Tumbleweed | ruby3-4-rubygem-rails-html-sanitizer | 1.6.0-1.7 | openSUSE-SU-2025:15125-1 |
| Tumbleweed | ruby4-0-rubygem-rails-html-sanitizer | 1.6.0-1.9 | openSUSE-SU-2026:10361-1 |
References
- access.redhat.com https://access.redhat.com/security/cve/CVE-2022-32209
- github.com https://github.com/rails/rails-html-sanitizer
- github.com https://github.com/rails/rails-html-sanitizer/commit/45a5c10fed3d9aa141594c80afa06d748fa0967d
- github.com https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2022-32209.yml
- groups.google.com https://groups.google.com/g/rubyonrails-security/c/ce9PhUANQ6s
- hackerone.com https://hackerone.com/reports/1530898
- lists.debian.org https://lists.debian.org/debian-lts-announce/2022/12/msg00012.html
- lists.debian.org https://lists.debian.org/debian-lts-announce/2024/09/msg00045.html
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AGRLWBEB3S5AU3D4TTROIS7O6QPHDTRH
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AGRLWBEB3S5AU3D4TTROIS7O6QPHDTRH/
Show all 16 references
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NHDACMCLWE32BZZTSNWQPIFUAD5I6Q47
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NHDACMCLWE32BZZTSNWQPIFUAD5I6Q47/
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AGRLWBEB3S5AU3D4TTROIS7O6QPHDTRH
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NHDACMCLWE32BZZTSNWQPIFUAD5I6Q47
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2022-32209
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2022-32209
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.