Version 1.6.0
rails-html-sanitizer
None
Install Instructions
gem install rails-html-sanitizer
Current Version Release Date May 26, 2023
Language Ruby
Package URL (purl) pkg:gem/rails-html-sanitizer@1.6.0
Find rails-html-sanitizer
vulnerabilities in your supply chain.
rails-html-sanitizer Vulnerabilities
Sort by
CVE (Latest)
CVE | CVSS Score | CWE(s) | EPSS Score | EPSS % | Impacted Versions |
---|---|---|---|---|---|
CVE-2022-23517 | High 7.5 | CWE-1333 | 0.00145 | 0.51712 |
|
CVE-2022-23518 | Medium 6.1 | CWE-79 | 0.0012 | 0.47661 |
|
CVE-2022-23519 | Medium 6.1 | CWE-79 | 0.00108 | 0.45168 |
|
CVE-2022-23520 | Medium 6.1 | CWE-79 | 0.00108 | 0.45168 |
|
CVE-2022-32209 | Medium 6.1 | CWE-79 | 0.00126 | 0.48649 |
|
CVE-2015-7578 | Medium 6.1 | CWE-79 | 0.00296 | 0.70065 |
|
CVE-2015-7579 | Medium 6.1 | CWE-79 | 0.00296 | 0.70065 |
|
CVE-2015-7580 | Medium 6.1 | CWE-79 | 0.00257 | 0.65827 |
|
CVE-2018-3741 | Medium 6.1 | CWE-79 | 0.00079 | 0.35702 |
|
rails-html-sanitizer Vulnerability Remediation Guidance
CVE | Description | Full list of Impacted Versions | Fix |
---|---|---|---|
CVE-2022-32209 | # 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"]```or```ruby# 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](https://hackerone.com/windshock?type=user). | 1.3.0, 1.2.0, 1.4.1, 1.1.0, 1.4.2, 1.4.0, 1.0.1, 1.0.0 (Show all) | Minor → 1.4.4 |
CVE-2022-23520 | 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. | 1.3.0, 1.4.3, 1.2.0, 1.4.1, 1.1.0, 1.4.2, 1.4.0, 1.0.1 (Show all) | Minor → 1.4.4 |
CVE-2022-23519 | 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. | 1.3.0, 1.4.3, 1.2.0, 1.4.1, 1.1.0, 1.4.2, 1.4.0, 1.0.1 (Show all) | Minor → 1.4.4 |
CVE-2022-23518 | rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Versions >= 1.0.3, < 1.4.4 are vulnerable to cross-site scripting via data URIs when used in combination with Loofah >= 2.1.0. This issue is patched in version 1.4.4. | 1.3.0, 1.4.3, 1.2.0, 1.4.1, 1.1.0, 1.4.2, 1.4.0, 1.0.3 (Show all) | Minor → 1.4.4 |
CVE-2022-23517 | rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Certain configurations of rails-html-sanitizer < 1.4.4 use an inefficient regular expression that is susceptible to excessive backtracking when attempting to sanitize certain SVG attributes. This may lead to a denial of service through CPU resource consumption. This issue has been patched in version 1.4.4. | 1.3.0, 1.4.3, 1.2.0, 1.4.1, 1.1.0, 1.4.2, 1.4.0, 1.0.1 (Show all) | Minor → 1.4.4 |
CVE-2018-3741 | There is a possible XSS vulnerability in all rails-html-sanitizer gem versions below 1.0.4 for Ruby. The gem allows non-whitelisted attributes to be present in sanitized output when input with specially-crafted HTML fragments, and these attributes can lead to an XSS attack on target applications. This issue is similar to CVE-2018-8048 in Loofah. All users running an affected release should either upgrade or use one of the workarounds immediately. | 1.0.1, 1.0.0, 1.0.2, 1.0.3 | Minor → 1.4.4 |
CVE-2015-7580 | Cross-site scripting (XSS) vulnerability in lib/rails/html/scrubbers.rb in the rails-html-sanitizer gem before 1.0.3 for Ruby on Rails 4.2.x and 5.x allows remote attackers to inject arbitrary web script or HTML via a crafted CDATA node. | 1.0.1, 1.0.0, 1.0.2 | Minor → 1.4.4 |
CVE-2015-7579 | Cross-site scripting (XSS) vulnerability in the rails-html-sanitizer gem 1.0.2 for Ruby on Rails 4.2.x and 5.x allows remote attackers to inject arbitrary web script or HTML via an HTML entity that is mishandled by the Rails::Html::FullSanitizer class. | 1.0.1, 1.0.0, 1.0.2 | Minor → 1.4.4 |
CVE-2015-7578 | Cross-site scripting (XSS) vulnerability in the rails-html-sanitizer gem before 1.0.3 for Ruby on Rails 4.2.x and 5.x allows remote attackers to inject arbitrary web script or HTML via crafted tag attributes. | 1.0.1, 1.0.0, 1.0.2 | Minor → 1.4.4 |
Instantly see if these rails-html-sanitizer
vulnerabilities affect your code.
Dependencies
Packages using versions of rails-html-sanitizer affected by its vulnerabilities
Dependent Packages |
---|
loofah~> 2.21 |
nokogiri~> 1.14 |