CVE-2022-23520 json
rails-html-sanitizer contains an incomplete fix for an XSS vulnerability
published 2022-12-13 3 y ago modified 2026-06-17 4 mo ago also GHSA-rrfc-7g8p-99q8 , EUVD-2022-7739
- cvss
- 6.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.2%
- EPSS 1.2% chance of exploitation in 30 days, percentile 68%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- rubygems rails-html-sanitizer 1.4.4
- rubyonrails rails_html_sanitizers 1.4.4
- ruby-rails-html-sanitizer Debian 14, Debian 13, Debian 12 1.4.4-1
debian advisories DEBIAN-CVE-2022-23520
- cjson satellite capsule 6.13, satellite 6.13 1.7.14-5.el8sat
- foreman satellite utils 6.13, satellite capsule 6.13, satellite 6.13 3.5.1.14-1.el8sat
- katello satellite capsule 6.13, satellite 6.13 4.7.0-1.el8sat
- libsolv satellite capsule 6.13, satellite 6.13 0.7.22-4.el8pc
- libcomps satellite capsule 6.13, satellite 6.13 0.1.18-4.el8pc
- qpid-cpp satellite capsule 6.13, satellite 6.13 1.39.0-7.el8amq
- qpid-qmf satellite capsule 6.13, satellite 6.13 1.39.0-7.el8amq
- candlepin satellite 6.13 4.2.13-1.el8sat
red hat advisories RHSA-2023:2097
- rubygem-rails-html-sanitizer SLE High Availability Extension 15 SP5, SLE High Availability Extension 15 SP4, SLE High Availability Extension 15 SP3 +4 more 1.0.4-150000.4.6.1
- rubygem-rails-html-sanitizer OpenStack Cloud Crowbar 9, OpenStack Cloud Crowbar 8 1.0.3-8.14.1
suse advisories SUSE-SU-2023:3714-1SUSE-SU-2023:3534-1
- rubygem-rails-html-sanitizer openSUSE Tumbleweed 1.6.0-1.9
- rubygem-rails-html-sanitizer openSUSE Tumbleweed 1.6.0-1.7
- rubygem-rails-html-sanitizer openSUSE Tumbleweed 1.6.0-1.5
- rubygem-rails-html-sanitizer openSUSE Tumbleweed 1.5.0-1.1
opensuse advisories openSUSE-SU-2026:10361-1openSUSE-SU-2025:15125-1openSUSE-SU-2024:14175-1openSUSE-SU-2024:12769-1
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-23520 updated cvss 6.1
rubygem-rails-html-sanitizer: Cross site scripting vulnerability with certain configurations
-
Red Hat 3scale API Management Platform 2 3scale-amp2/zync-rhel8affected: no fix planned “Will not fix”
-
Red Hat Satellite 6 rubygem-rails-html-sanitizer, tfm-ror51-rubygem-rails-html-sanitizer, tfm-ror52-rubygem-rails-html-sanitizeraffected: no fix available, no fix planned “Out of support scope”
-
Red Hat Satellite 6.13 for RHEL 8 rubygem-rails-html-sanitizer 1.4.4-1.el8satfixed: vendor fix RHSA-2023:2097
-
Red Hat Satellite 6.13 for RHEL 8 cjson 1.7.14-5.el8sat, katello 4.7.0-1.el8sat, libsolv 0.7.22-4.el8pc, libcomps 0.1.18-4.el8pc, python-idna 3.3-2.el8pc, python-pbr 5.8.0-4.el8pc, +670 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
1.19% chance of exploitation in the next 30 days, higher than 68% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-rrfc-7g8p-99q8 referenced PoC, tagged "exploit" by a source, unverified
- hackerone.com https://hackerone.com/reports/1654310 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| rubygems | rails-html-sanitizer | <1.4.4 |
1.4.4 |
Affected products
- rails rails-html-sanitizer
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
- Technology feeds
References
-
github.com
/rails/rails-html-sanitizer/security/advisories/GHSA-rrfc-7g8p-99q8
web, exploit, third-party-advisory
-
hackerone.com
/reports/1654310
web, exploit, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2023/09/msg00012.html
web, mailing-list, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2024/09/msg00045.html
web
-
nvd.nist.gov
/vuln/detail/CVE-2022-23520
advisory
-
github.com
/rails/rails-html-sanitizer
package
-
github.com
/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2022-23520.yml
web
Sources
- CVE List CVE-2022-23520
- GitHub Advisory GHSA-rrfc-7g8p-99q8
- NVD CVE-2022-23520
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.