Description
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. There is a possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer 1.6.0 when used with Rails >= 7.1.0 and Nokogiri < 1.15.7, or 1.16.x < 1.16.8. The XSS vulnerability with certain configurations of Rails::HTML::Sanitizer may allow an attacker to inject content if HTML5 sanitization is enabled and the application developer has overridden the sanitizer's allowed tags with both "math" and "style" elements or both both "svg" and "style" elements. This vulnerability is fixed in 1.6.1.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| rails | rails-html-sanitizer | >= 1.6.0, < 1.6.1 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | ruby-rails-html-sanitizer | No fix yet | — |
| Ubuntu 26.04 LTS | ruby-rails-html-sanitizer | No fix yet | — |
| Ubuntu 25.10 | ruby-rails-html-sanitizer | No fix yet | — |
| Ubuntu 24.04 LTS | ruby-rails-html-sanitizer | No fix yet | — |
| Ubuntu 22.04 LTS | ruby-rails-html-sanitizer | No fix yet | — |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | ruby-rails-html-sanitizer | No fix yet | — |
| Ubuntu 18.04 LTS | ruby-rails-html-sanitizer | No fix yet | — |
| Ubuntu 16.04 LTS | ruby-rails-html-sanitizer | No fix yet | — |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | rubygem-rails-html-sanitizer | 1.7.0-1.1 | openSUSE-SU-2026:10569-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| RubyGems | rails-html-sanitizer | >= 1.6.0, < 1.6.1 | 1.6.1 | GHSA-w8gc-x259-rc7x |
Advisories 2
- openSUSE-SU-2026:10569-1 ruby4.0-rubygem-rails-html-sanitizer-1.7.0-1.1 on GA media SUSE / openSUSE Security Updates · Apr 18, 2026
- WID-SEC-2024-3581 Ruby on Rails: Mehrere Schwachstellen ermöglichen Cross-Site Scripting BSI CERT-Bund (WID) · Dec 2, 2024