Vulnerability · Published Dec 14, 2022 · Assigned by GitHub_M

CVE-2022-23519Possible XSS vulnerability with certain configurations of rails-html-sanitizer

High 7.2

In plain English

A high-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.1% (higher than 65% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.2High
Exploit odds (30 days)1.1%top 35.4% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

Official description

rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Prior to version 1.4.4, a 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 in either of the following ways: allow both "math" and "style" elements, or allow both "svg" and "style" elements. Code is only impacted if allowed tags are being overridden. . This issue is fixed in version 1.4.4. All users overriding the allowed tags to include "math" or "svg" and "style" should either upgrade or use the following workaround immediately: Remove "style" from the overridden allowed tags, or remove "math" and "svg" from the overridden allowed tags.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12ruby-rails-html-sanitizer1.4.4-1DEBIAN-CVE-2022-23519
Debian:13ruby-rails-html-sanitizer1.4.4-1DEBIAN-CVE-2022-23519
Debian:14ruby-rails-html-sanitizer1.4.4-1DEBIAN-CVE-2022-23519
RubyGemsrails-html-sanitizer1.4.4GHSA-9h9g-93gc-623h
Ubuntu:22.04:LTSruby-rails-html-sanitizerno fix listedUBUNTU-CVE-2022-23519
Ubuntu:24.04:LTSruby-rails-html-sanitizerno fix listedUBUNTU-CVE-2022-23519
Ubuntu:25.10ruby-rails-html-sanitizerno fix listedUBUNTU-CVE-2022-23519
Ubuntu:26.04:LTSruby-rails-html-sanitizerno fix listedUBUNTU-CVE-2022-23519
Ubuntu:26.10ruby-rails-html-sanitizerno fix listedUBUNTU-CVE-2022-23519

Affected products (as reported)

VendorProductVersions
rails rails-html-sanitizer < 1.4.4

Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N

References