Skip to content

← Public intelligence

RubyGems package

rails-html-sanitizer

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

15 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Medium, CVSS 5.1RubyGemsPublished

    Rails HTML Sanitizers: Possible XSS vulnerability with certain configurations

    CVE-2026-73648 · GHSA-cj75-f6xr-r4g7

    Affected
    • RubyGems rails-html-sanitizer >= 1.0.3, < 1.7.1
    Fixed in
    1.7.1· Vendor fix available
    Issue
    There is a possible cross-site scripting vulnerability in rails-html-sanitizer when the sanitizer is configured to allow an SVG reference element such as <use. See related GHSA-9wjq-cp2p-hrgf in Loofah, whose SVG local-reference logic rails-html-sanitizer mirrors. - Versions affected: = 1.0.3, < 1.7.1 - Not affected: < 1.0.3 - Fixed versions: 1.7.1 Impact Rails::HTML::PermitScrubber restricts SVG reference elements in the SVGALLOWLOCALHREF collection to local, same-document references, but that restriction covered only the xlink:href attribute. Browsers also accept a plain href attribute per the SVG 2 spec, and it was not restricted, so those elements could reference arbitrary external documents. SVG <use can load and render external SVG content by reference, and if the referenced document is same-origin and contains scripts, it could execute in the context of the sanitized document. <feImage can load external images, which can be used for tracking. Applications are impacted…

    Recommended action: Upgrade to 1.7.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  2. Low, CVSS 2.3RubyGemsPublished

    rails-html-sanitizer has XSS vulnerability with certain configurations

    CVE-2024-53989 · GHSA-rxv5-gxqc-xx8g

    Affected
    • RubyGems rails-html-sanitizer >= 1.6.0, <= 1.6.0
    Fixed in
    1.6.1· Vendor fix available
    Issue
    There is a possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer 1.6.0 when used with Rails = 7.1.0. Versions affected: 1.6.0 Not affected: < 1.6.0 Fixed versions: 1.6.1 Impact A possible 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 in the following way: - the "noscript" element is explicitly allowed Code is only impacted if Rails is configured to use HTML5 sanitization, please see documentation for config.actionview.sanitizervendor and config.actiontext.sanitizervendor for more information on these configuration options. The default configuration is to disallow all of these elements. Code is only impacted if allowed tags are being overridden. Applications may be doing this in a few different ways: 1. using application configuration to configure Action View sanitizers' allowed…

    Recommended action: Upgrade to 1.6.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  3. Low, CVSS 2.3RubyGemsPublished

    rails-html-sanitizer has XSS vulnerability with certain configurations

    CVE-2024-53987 · GHSA-2x5m-9ch4-qgrr

    Affected
    • RubyGems rails-html-sanitizer >= 1.6.0, <= 1.6.0
    Fixed in
    1.6.1· Vendor fix available
    Issue
    There is a possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer 1.6.0 when used with Rails = 7.1.0. Versions affected: 1.6.0 Not affected: < 1.6.0 Fixed versions: 1.6.1 Impact A possible 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 in the following way: - the "style" element is explicitly allowed - the "svg" or "math" element is not allowed Code is only impacted if Rails is configured to use HTML5 sanitization, please see documentation for config.actionview.sanitizervendor and config.actiontext.sanitizervendor for more information on these configuration options. The default configuration is to disallow all of these elements. Code is only impacted if allowed tags are being overridden. Applications may be doing this in a few different ways: 1. using application configuration to…

    Recommended action: Upgrade to 1.6.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  4. Low, CVSS 2.3RubyGemsPublished

    rails-html-sanitizer has XSS vulnerability with certain configurations

    CVE-2024-53988 · GHSA-cfjx-w229-hgx5

    Affected
    • RubyGems rails-html-sanitizer >= 1.6.0, <= 1.6.0
    Fixed in
    1.6.1· Vendor fix available
    Issue
    There is a possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer 1.6.0 when used with Rails = 7.1.0. Versions affected: 1.6.0 Not affected: < 1.6.0 Fixed versions: 1.6.1 Impact A possible 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 in the following way: - the "math", "mtext", "table", and "style" elements are allowed - and either "mglyph" or "malignmark" are allowed Code is only impacted if Rails is configured to use HTML5 sanitization, please see documentation for config.actionview.sanitizervendor and config.actiontext.sanitizervendor for more information on these configuration options. The default configuration is to disallow all of these elements except for "table". Code is only impacted if allowed tags are being overridden. Applications may be doing this in a few different…

    Recommended action: Upgrade to 1.6.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  5. Low, CVSS 2.3RubyGemsPublished

    rails-html-sanitizer has XSS vulnerability with certain configurations

    CVE-2024-53986 · GHSA-638j-pmjw-jq48

    Affected
    • RubyGems rails-html-sanitizer >= 1.6.0, <= 1.6.0
    Fixed in
    1.6.1· Vendor fix available
    Issue
    There is a possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer 1.6.0 when used with Rails = 7.1.0. Versions affected: 1.6.0 Not affected: < 1.6.0 Fixed versions: 1.6.1 Impact A possible 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 in the following way: - the "math" and "style" elements are both explicitly allowed Code is only impacted if Rails is configured to use HTML5 sanitization, please see documentation for config.actionview.sanitizervendor and config.actiontext.sanitizervendor for more information on these configuration options. The default configuration is to disallow these elements. Code is only impacted if allowed tags are being overridden. Applications may be doing this in a few different ways: 1. using application configuration to configure Action View sanitizers'…

    Recommended action: Upgrade to 1.6.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  6. Low, CVSS 2.3RubyGemsPublished

    rails-html-sanitize has XSS vulnerability with certain configurations

    CVE-2024-53985 · GHSA-w8gc-x259-rc7x

    Affected
    • RubyGems rails-html-sanitizer >= 1.6.0, <= 1.6.0
    Fixed in
    1.6.1· Vendor fix available
    Issue
    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. Versions affected: 1.6.0 Not affected: < 1.6.0 Fixed versions: 1.6.1 Please note that the fix in v1.6.1 is to update the dependency on Nokogiri to 1.15.7 or = 1.16.8. Impact A possible 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 in either of the following ways: allow both "math" and "style" elements or allow both "svg" and "style" elements Code is only impacted if Rails is configured to use HTML5 sanitization, please see documentation for config.actionview.sanitizervendor and config.actiontext.sanitizervendor for more information on these configuration options. Code is only impacted if allowed tags are being overridden. Applications may…

    Recommended action: Upgrade to 1.6.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  7. Medium, CVSS 6.1RubyGemsPublished

    Possible XSS vulnerability with certain configurations of rails-html-sanitizer

    CVE-2022-23520 · GHSA-rrfc-7g8p-99q8

    Affected
    • RubyGems rails-html-sanitizer < 1.4.4
    Fixed in
    1.4.4· Vendor fix available
    Issue
    There is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer. This is due to an incomplete fix of CVE-2022-32209. - Versions affected: ALL - Not affected: NONE - Fixed versions: 1.4.4 Impact 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 to allow both "select" and "style" elements. Code is only impacted if allowed tags are being overridden using either of the following two mechanisms: 1. Using the Rails configuration config.actionview.sanitizedallowtags=: (see https://guides.rubyonrails.org/configuring.html#configuring-action-view) 2. Using the class method Rails::Html::SafeListSanitizer.allowedtags=: All users overriding the allowed tags by either of the above mechanisms to include both "select" and "style" should either upgrade or use one of the workarounds immediately. NOTE: Code is not impacted…

    Recommended action: Upgrade to 1.4.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  8. Medium, CVSS 6.1RubyGemsPublished

    Possible XSS vulnerability with certain configurations of rails-html-sanitizer

    CVE-2022-23519 · GHSA-9h9g-93gc-623h

    Affected
    • RubyGems rails-html-sanitizer < 1.4.4
    Fixed in
    1.4.4· Vendor fix available
    Issue
    There is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer. - Versions affected: ALL - Not affected: NONE - Fixed versions: 1.4.4 Impact 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. Applications may be doing this in four different ways: 1. using application configuration: see https://guides.rubyonrails.org/configuring.html#configuring-action-view 2. using a :tags option to the Action View helper sanitize: see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize 3. using Rails::Html::SafeListSanitizer class method allowedtags=: 4. using a :tags options to the…

    Recommended action: Upgrade to 1.4.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  9. Medium, CVSS 6.1RubyGemsPublished

    Improper neutralization of data URIs may allow XSS in rails-html-sanitizer

    CVE-2022-23518 · GHSA-mcvf-2q2m-x72m

    Affected
    • RubyGems rails-html-sanitizer >= 1.0.3, < 1.4.4
    Fixed in
    1.4.4· Vendor fix available
    Issue
    rails-html-sanitizer = 1.0.3, < 1.4.4 is vulnerable to cross-site scripting via data URIs when used in combination with Loofah = 2.1.0. Mitigation Upgrade to rails-html-sanitizer = 1.4.4. Severity The maintainers have evaluated this as Medium Severity 6.1. References - CWE - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (4.9) - SVG MIME Type (image/svg+xml) is misleading to developers · Issue #266 · w3c/svgwg - https://github.com/rails/rails-html-sanitizer/issues/135 - https://hackerone.com/reports/1694173 Credit This vulnerability was independently reported by Maciej Piechota (@haqpl) and Mrinmoy Das (@goromlagche).

    Recommended action: Upgrade to 1.4.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  10. High, CVSS 7.5RubyGemsPublished

    Inefficient Regular Expression Complexity in rails-html-sanitizer

    CVE-2022-23517 · GHSA-5x79-w82f-gw8w

    Affected
    • RubyGems rails-html-sanitizer < 1.4.4
    Fixed in
    1.4.4· Vendor fix available
    Issue
    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. Mitigation Upgrade to rails-html-sanitizer = 1.4.4. Severity The maintainers have evaluated this as High Severity 7.5 (CVSS3.1). References - CWE - CWE-1333: Inefficient Regular Expression Complexity (4.9) - https://hackerone.com/reports/1684163 Credit This vulnerability was responsibly reported by @ooooooo-q (https://github.com/ooooooo-q).

    Recommended action: Upgrade to 1.4.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  11. Medium, CVSS 6.1RubyGemsPublished

    Rails::Html::Sanitizer vulnerable to Cross-site Scripting

    CVE-2022-32209 · GHSA-pg8v-g4xq-hww9

    Affected
    • RubyGems rails-html-sanitizer < 1.4.3
    Fixed in
    1.4.3· Vendor fix available
    Issue
    Versions of Rails::Html::Sanitizer prior to version 1.4.3 are vulnerable to XSS with certain configurations of Rails::Html::Sanitizer which allows an attacker to inject content when 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: see https://guides.rubyonrails.org/configuring.html#configuring-action-view Or it may be done with a :tags option to the Action View helper sanitize: see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize It may also be done with Rails::Html::SafeListSanitizer directly: or with All users overriding the allowed tags by any of the above mechanisms to include both "select" and "style" are recommended to upgrade immediately. A workaround for this issue can be applied by removing either select or style from the overridden allowed tags.

    Recommended action: Upgrade to 1.4.3 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  12. Medium, CVSS 6.1RubyGemsPublished

    rails-html-sanitizer Cross-site Scripting vulnerability

    CVE-2018-3741 · GHSA-px3r-jm9g-c8w8

    Affected
    • RubyGems rails-html-sanitizer < 1.0.4
    Fixed in
    1.0.4· Vendor fix available
    Issue
    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.

    Recommended action: Upgrade to 1.0.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  13. Medium, CVSS 6.1RubyGemsPublished

    rails-html-sanitizer Cross-site Scripting vulnerability

    CVE-2015-7578 · GHSA-59c7-4xj2-hgvw

    Affected
    • RubyGems rails-html-sanitizer < 1.0.3
    Fixed in
    1.0.3· Vendor fix available
    Issue
    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.

    Recommended action: Upgrade to 1.0.3 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  14. Medium, CVSS 6.1RubyGemsPublished

    rails-html-sanitizer Cross-site Scripting vulnerability

    CVE-2015-7580 · GHSA-ghqm-pgxj-37gq

    Affected
    • RubyGems rails-html-sanitizer < 1.0.3
    Fixed in
    1.0.3· Vendor fix available
    Issue
    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.

    Recommended action: Upgrade to 1.0.3 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  15. Medium, CVSS 6.1RubyGemsPublished

    rails-html-sanitizer Cross-site Scripting vulnerability

    CVE-2015-7579 · GHSA-r9c2-cr39-c8g6

    Affected
    • RubyGems rails-html-sanitizer < 1.0.3
    Fixed in
    1.0.3· Vendor fix available
    Issue
    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.

    Recommended action: Upgrade to 1.0.3 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →