Staging Environment: Content and features may be unstable or change without notice.
Search for packages
Package details: pkg:gem/rails-html-sanitizer@1.0.2
purl pkg:gem/rails-html-sanitizer@1.0.2
Next non-vulnerable version 1.6.1
Latest non-vulnerable version 1.6.1
Risk 4.0
Vulnerabilities affecting this package (16)
Vulnerability Summary Fixed by
VCID-2ece-9xu2-z7ea
Aliases:
CVE-2015-7580
GHSA-ghqm-pgxj-37gq
XSS vulnerability - white list bypass Carefully crafted strings can cause user input to bypass the sanitization in the white list sanitizer which can lead to an XSS attack.
1.0.3
Affected by 11 other vulnerabilities.
VCID-327c-vdne-j7ar
Aliases:
GHSA-qc8j-m8j3-rjq6
Moderate severity vulnerability that affects rails-html-sanitizer Withdrawn, accidental duplicate publish. 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.3
Affected by 11 other vulnerabilities.
VCID-6158-4ade-h7ba
Aliases:
GHSA-77pc-q5q7-qg9h
Moderate severity vulnerability that affects rails-html-sanitizer Withdrawn, accidental duplicate publish. 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.3
Affected by 11 other vulnerabilities.
VCID-63em-3vdj-j3cu
Aliases:
CVE-2022-23517
GHSA-5x79-w82f-gw8w
GMS-2022-8298
Inefficient Regular Expression Complexity in rails-html-sanitizer ## Summary 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)](https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H). ## References - [CWE - CWE-1333: Inefficient Regular Expression Complexity (4.9)](https://cwe.mitre.org/data/definitions/1333.html) - https://hackerone.com/reports/1684163 ## Credit This vulnerability was responsibly reported by @ooooooo-q (https://github.com/ooooooo-q).
1.4.4
Affected by 5 other vulnerabilities.
VCID-782b-usu3-bbhd
Aliases:
CVE-2022-23519
GHSA-9h9g-93gc-623h
GMS-2022-8299
Possible XSS vulnerability with certain configurations of rails-html-sanitizer ## Summary 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: ```ruby # In config/application.rb config.action_view.sanitized_allowed_tags = ["math", "style"] # or config.action_view.sanitized_allowed_tags = ["svg", "style"] ``` see https://guides.rubyonrails.org/configuring.html#configuring-action-view 2. using a `:tags` option to the Action View helper `sanitize`: ``` <%= sanitize @comment.body, tags: ["math", "style"] %> <%# or %> <%= sanitize @comment.body, tags: ["svg", "style"] %> ``` see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize 3. using Rails::Html::SafeListSanitizer class method `allowed_tags=`: ```ruby # class-level option Rails::Html::SafeListSanitizer.allowed_tags = ["math", "style"] # or Rails::Html::SafeListSanitizer.allowed_tags = ["svg", "style"] ``` 4. using a `:tags` options to the Rails::Html::SafeListSanitizer instance method `sanitize`: ```ruby # instance-level option Rails::Html::SafeListSanitizer.new.sanitize(@article.body, tags: ["math", "style"]) # or Rails::Html::SafeListSanitizer.new.sanitize(@article.body, tags: ["svg", "style"]) ``` All users overriding the allowed tags by any of the above mechanisms to include (("math" or "svg") and "style") should either upgrade or use one of the workarounds immediately. ## Workarounds Remove "style" from the overridden allowed tags, or remove "math" and "svg" from the overridden allowed tags. ## References - [CWE - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (4.9)](https://cwe.mitre.org/data/definitions/79.html) - https://hackerone.com/reports/1656627 ## Credit This vulnerability was responsibly reported by Dominic Breuker.
1.4.4
Affected by 5 other vulnerabilities.
VCID-an3h-1c9y-f3bp
Aliases:
GHSA-mrhj-2g4v-39qx
Moderate severity vulnerability that affects rails-html-sanitizer Withdrawn, accidental duplicate publish. 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.3
Affected by 11 other vulnerabilities.
VCID-apxn-up79-x3ge
Aliases:
CVE-2024-53989
GHSA-rxv5-gxqc-xx8g
rails-html-sanitizer has XSS vulnerability with certain configurations ## Summary 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.action_view.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-view-sanitizer-vendor) and [`config.action_text.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-text-sanitizer-vendor) 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 tags: ```ruby # In config/application.rb config.action_view.sanitized_allowed_tags = ["noscript"] ``` see https://guides.rubyonrails.org/configuring.html#configuring-action-view 2. using a `:tags` option to the Action View helper `sanitize`: ``` <%= sanitize @comment.body, tags: ["noscript"] %> ``` see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize 3. setting Rails::HTML5::SafeListSanitizer class attribute `allowed_tags`: ```ruby # class-level option Rails::HTML5::SafeListSanitizer.allowed_tags = ["noscript"] ``` (note that this class may also be referenced as `Rails::Html::SafeListSanitizer`) 4. using a `:tags` options to the Rails::HTML5::SafeListSanitizer instance method `sanitize`: ```ruby # instance-level option Rails::HTML5::SafeListSanitizer.new.sanitize(@article.body, tags: ["noscript"]) ``` (note that this class may also be referenced as `Rails::Html::SafeListSanitizer`) 5. setting ActionText::ContentHelper module attribute `allowed_tags`: ```ruby ActionText::ContentHelper.allowed_tags = ["noscript"] ``` All users overriding the allowed tags by any of the above mechanisms to include "noscript" should either upgrade or use one of the workarounds. ## Workarounds Any one of the following actions will work around this issue: - Remove "noscript" from the overridden allowed tags, - Or, downgrade sanitization to HTML4 (see documentation for [`config.action_view.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-view-sanitizer-vendor) and [`config.action_text.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-text-sanitizer-vendor) for more information). ## References - [CWE - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (4.9)](https://cwe.mitre.org/data/definitions/79.html) - Original report: https://hackerone.com/reports/2509647 ## Credit This vulnerability was responsibly reported by So Sakaguchi ([mokusou](https://hackerone.com/mokusou)) and [taise](https://hackerone.com/taise).
1.6.1
Affected by 0 other vulnerabilities.
VCID-cphr-tdzs-x7ar
Aliases:
CVE-2024-53985
GHSA-w8gc-x259-rc7x
rails-html-sanitize has XSS vulnerability with certain configurations ## Summary 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.action_view.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-view-sanitizer-vendor) and [`config.action_text.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-text-sanitizer-vendor) for more information on these configuration options. 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 tags: ```ruby # In config/application.rb config.action_view.sanitized_allowed_tags = ["math", "style"] # or config.action_view.sanitized_allowed_tags = ["svg", "style"] ``` see https://guides.rubyonrails.org/configuring.html#configuring-action-view 2. using a `:tags` option to the Action View helper `sanitize`: ``` <%= sanitize @comment.body, tags: ["math", "style"] %> <%# or %> <%= sanitize @comment.body, tags: ["svg", "style"] %> ``` see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize 3. setting Rails::HTML5::SafeListSanitizer class attribute `allowed_tags`: ```ruby # class-level option Rails::HTML5::SafeListSanitizer.allowed_tags = ["math", "style"] # or Rails::HTML5::SafeListSanitizer.allowed_tags = ["svg", "style"] ``` (note that this class may also be referenced as `Rails::Html::SafeListSanitizer`) 4. using a `:tags` options to the Rails::HTML5::SafeListSanitizer instance method `sanitize`: ```ruby # instance-level option Rails::HTML5::SafeListSanitizer.new.sanitize(@article.body, tags: ["math", "style"]) # or Rails::HTML5::SafeListSanitizer.new.sanitize(@article.body, tags: ["svg", "style"]) ``` (note that this class may also be referenced as `Rails::Html::SafeListSanitizer`) 5. setting ActionText::ContentHelper module attribute `allowed_tags`: ```ruby ActionText::ContentHelper.allowed_tags = ["math", "style"] # or ActionText::ContentHelper.allowed_tags = ["svg", "style"] ``` All users overriding the allowed tags by any of the above mechanisms to include (("math" or "svg") and "style") should either upgrade or use one of the workarounds. ## Workarounds Any one of the following actions will work around this issue: - Remove "style" from the overridden allowed tags, - Or, remove "math" and "svg" from the overridden allowed tags, - Or, downgrade sanitization to HTML4 (see documentation for [`config.action_view.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-view-sanitizer-vendor) and [`config.action_text.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-text-sanitizer-vendor) for more information) - Or, independently upgrade Nokogiri to v1.15.7 or >= 1.16.8. ## References - [CWE - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (4.9)](https://cwe.mitre.org/data/definitions/79.html) - Original report: https://hackerone.com/reports/2503220 ## Credit This vulnerability was responsibly reported by So Sakaguchi ([mokusou](https://hackerone.com/mokusou)) and [taise](https://hackerone.com/taise).
1.6.1
Affected by 0 other vulnerabilities.
VCID-ete9-xwuw-puf8
Aliases:
CVE-2022-32209
GHSA-pg8v-g4xq-hww9
Rails::Html::Sanitizer vulnerable to Cross-site Scripting 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: ```ruby# In config/application.rbconfig.action_view.sanitized_allowed_tags = ["select", "style"]``` 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`: ```<%= sanitize @comment.body, tags: ["select", "style"] %>``` see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize It may also be done with Rails::Html::SafeListSanitizer directly: ```ruby# class-level optionRails::Html::SafeListSanitizer.allowed_tags = ["select", "style"]``` or with ```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" are recommended to upgrade immediately. A workaround for this issue can be applied by removing either `select` or `style` from the overridden allowed tags.
1.4.3
Affected by 9 other vulnerabilities.
VCID-nc6s-6usd-gkeb
Aliases:
CVE-2015-7578
GHSA-59c7-4xj2-hgvw
Possible XSS vulnerability Certain attributes are not removed from tags when they are sanitized, and these attributes can lead to an XSS attack on target applications.
1.0.3
Affected by 11 other vulnerabilities.
VCID-rhb1-h2b8-jucb
Aliases:
CVE-2024-53987
GHSA-2x5m-9ch4-qgrr
rails-html-sanitizer has XSS vulnerability with certain configurations ## Summary 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.action_view.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-view-sanitizer-vendor) and [`config.action_text.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-text-sanitizer-vendor) 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 tags: ```ruby # In config/application.rb config.action_view.sanitized_allowed_tags = ["style"] ``` see https://guides.rubyonrails.org/configuring.html#configuring-action-view 2. using a `:tags` option to the Action View helper `sanitize`: ``` <%= sanitize @comment.body, tags: ["style"] %> ``` see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize 3. setting Rails::HTML5::SafeListSanitizer class attribute `allowed_tags`: ```ruby # class-level option Rails::HTML5::SafeListSanitizer.allowed_tags = ["style"] ``` (note that this class may also be referenced as `Rails::Html::SafeListSanitizer`) 4. using a `:tags` options to the Rails::HTML5::SafeListSanitizer instance method `sanitize`: ```ruby # instance-level option Rails::HTML5::SafeListSanitizer.new.sanitize(@article.body, tags: ["style"]) ``` (note that this class may also be referenced as `Rails::Html::SafeListSanitizer`) 5. setting ActionText::ContentHelper module attribute `allowed_tags`: ```ruby ActionText::ContentHelper.allowed_tags = ["style"] ``` All users overriding the allowed tags by any of the above mechanisms to include "style" and omit "svg" or "math" should either upgrade or use one of the workarounds. ## Workarounds Any one of the following actions will work around this issue: - Remove "style" from the overridden allowed tags, - Or, downgrade sanitization to HTML4 (see documentation for [`config.action_view.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-view-sanitizer-vendor) and [`config.action_text.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-text-sanitizer-vendor) for more information). ## References - [CWE - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (4.9)](https://cwe.mitre.org/data/definitions/79.html) - Original report: https://hackerone.com/reports/2519936 ## Credit This vulnerability was responsibly reported by So Sakaguchi ([mokusou](https://hackerone.com/mokusou)) and [taise](https://hackerone.com/taise).
1.6.1
Affected by 0 other vulnerabilities.
VCID-rz3c-6h7r-6bam
Aliases:
CVE-2024-53988
GHSA-cfjx-w229-hgx5
rails-html-sanitizer has XSS vulnerability with certain configurations ## Summary 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.action_view.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-view-sanitizer-vendor) and [`config.action_text.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-text-sanitizer-vendor) 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 ways: 1. using application configuration to configure Action View sanitizers' allowed tags: ```ruby # In config/application.rb config.action_view.sanitized_allowed_tags = ["math", "mtext", "table", "style", "mglyph"] # or config.action_view.sanitized_allowed_tags = ["math", "mtext", "table", "style", "malignmark"] ``` see https://guides.rubyonrails.org/configuring.html#configuring-action-view 2. using a `:tags` option to the Action View helper `sanitize`: ``` <%= sanitize @comment.body, tags: ["math", "mtext", "table", "style", "mglyph"] %> <%# or %> <%= sanitize @comment.body, tags: ["math", "mtext", "table", "style", "malignmark"] %> ``` see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize 3. setting Rails::HTML5::SafeListSanitizer class attribute `allowed_tags`: ```ruby # class-level option Rails::HTML5::SafeListSanitizer.allowed_tags = ["math", "mtext", "table", "style", "mglyph"] # or Rails::HTML5::SafeListSanitizer.allowed_tags = ["math", "mtext", "table", "style", "malignmark"] ``` (note that this class may also be referenced as `Rails::Html::SafeListSanitizer`) 4. using a `:tags` options to the Rails::HTML5::SafeListSanitizer instance method `sanitize`: ```ruby # instance-level option Rails::HTML5::SafeListSanitizer.new.sanitize(@article.body, tags: ["math", "mtext", "table", "style", "mglyph"]) # or Rails::HTML5::SafeListSanitizer.new.sanitize(@article.body, tags: ["math", "mtext", "table", "style", "malignmark"]) ``` (note that this class may also be referenced as `Rails::Html::SafeListSanitizer`) 5. setting ActionText::ContentHelper module attribute `allowed_tags`: ```ruby ActionText::ContentHelper.allowed_tags = ["math", "mtext", "table", "style", "mglyph"] # or ActionText::ContentHelper.allowed_tags = ["math", "mtext", "table", "style", "malignmark"] ``` All users overriding the allowed tags by any of the above mechanisms to include ("math" and "mtext" and "table" and "style" and ("mglyph" or "malignmark")) should either upgrade or use one of the workarounds. ## Workarounds Any one of the following actions will work around this issue: - Remove "mglyph" and "malignmark" from the overridden allowed tags, - Or, downgrade sanitization to HTML4 (see documentation for [`config.action_view.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-view-sanitizer-vendor) and [`config.action_text.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-text-sanitizer-vendor) for more information). ## References - [CWE - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (4.9)](https://cwe.mitre.org/data/definitions/79.html) - Original report: https://hackerone.com/reports/2519936 ## Credit This vulnerability was responsibly reported by So Sakaguchi ([mokusou](https://hackerone.com/mokusou)) and [taise](https://hackerone.com/taise).
1.6.1
Affected by 0 other vulnerabilities.
VCID-ueen-aybd-tqh2
Aliases:
CVE-2024-53986
GHSA-638j-pmjw-jq48
rails-html-sanitizer has XSS vulnerability with certain configurations ## Summary 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.action_view.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-view-sanitizer-vendor) and [`config.action_text.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-text-sanitizer-vendor) 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' allowed tags: ```ruby # In config/application.rb config.action_view.sanitized_allowed_tags = ["math", "style"] ``` see https://guides.rubyonrails.org/configuring.html#configuring-action-view 2. using a `:tags` option to the Action View helper `sanitize`: ``` <%= sanitize @comment.body, tags: ["math", "style"] %> ``` see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize 3. setting Rails::HTML5::SafeListSanitizer class attribute `allowed_tags`: ```ruby # class-level option Rails::HTML5::SafeListSanitizer.allowed_tags = ["math", "style"] ``` (note that this class may also be referenced as `Rails::Html::SafeListSanitizer`) 4. using a `:tags` options to the Rails::HTML5::SafeListSanitizer instance method `sanitize`: ```ruby # instance-level option Rails::HTML5::SafeListSanitizer.new.sanitize(@article.body, tags: ["math", "style"]) ``` (note that this class may also be referenced as `Rails::Html::SafeListSanitizer`) 5. setting ActionText::ContentHelper module attribute `allowed_tags`: ```ruby ActionText::ContentHelper.allowed_tags = ["math", "style"] ``` All users overriding the allowed tags by any of the above mechanisms to include both "math" and "style" should either upgrade or use one of the workarounds. ## Workarounds Any one of the following actions will work around this issue: - Remove "math" or "style" from the overridden allowed tags, - Or, downgrade sanitization to HTML4 (see documentation for [`config.action_view.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-view-sanitizer-vendor) and [`config.action_text.sanitizer_vendor`](https://guides.rubyonrails.org/configuring.html#config-action-text-sanitizer-vendor) for more information). ## References - [CWE - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (4.9)](https://cwe.mitre.org/data/definitions/79.html) - Original report: https://hackerone.com/reports/2519941 ## Credit This vulnerability was responsibly reported by So Sakaguchi ([mokusou](https://hackerone.com/mokusou)) and [taise](https://hackerone.com/taise).
1.6.1
Affected by 0 other vulnerabilities.
VCID-ujza-s7ug-9fcp
Aliases:
CVE-2015-7579
GHSA-r9c2-cr39-c8g6
XSS vulnerability in strip_tags Due to the way that `Rails::Html::FullSanitizer` is implemented, if an attacker passes an already escaped HTML entity to the input of Action View's `strip_tags` these entities will be unescaped what may cause a XSS attack if used in combination with `raw` or `html_safe`.
1.0.3
Affected by 11 other vulnerabilities.
VCID-xby9-avva-a3e5
Aliases:
CVE-2018-3741
GHSA-px3r-jm9g-c8w8
XSS vulnerability The gem allows attributes that are not specified in the allowlist 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.
1.0.4
Affected by 10 other vulnerabilities.
VCID-zcs7-hzze-u3a5
Aliases:
CVE-2022-23520
GHSA-rrfc-7g8p-99q8
GMS-2022-8301
Possible XSS vulnerability with certain configurations of rails-html-sanitizer ## Summary 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.action_view.sanitized_allow_tags=`: ```ruby # In config/application.rb config.action_view.sanitized_allowed_tags = ["select", "style"] ``` (see https://guides.rubyonrails.org/configuring.html#configuring-action-view) 2. Using the class method `Rails::Html::SafeListSanitizer.allowed_tags=`: ```ruby # class-level option Rails::Html::SafeListSanitizer.allowed_tags = ["select", "style"] ``` 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 if allowed tags are overridden using either of the following mechanisms: - the `:tags` option to the Action View helper method `sanitize`. - the `:tags` option to the instance method `SafeListSanitizer#sanitize`. ## Workarounds Remove either "select" or "style" from the overridden allowed tags. ## References - [CWE - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (4.9)](https://cwe.mitre.org/data/definitions/79.html) - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-32209 - https://hackerone.com/reports/1654310 ## Credit This vulnerability was responsibly reported by Dominic Breuker.
1.4.4
Affected by 5 other vulnerabilities.
Vulnerabilities fixed by this package (0)
Vulnerability Summary Aliases
This package is not known to fix vulnerabilities.

Date Actor Action Vulnerability Source VulnerableCode Version
2026-04-16T22:18:07.587162+00:00 GitLab Importer Affected by VCID-zcs7-hzze-u3a5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23520.yml 38.4.0
2026-04-16T22:18:00.996379+00:00 GitLab Importer Affected by VCID-782b-usu3-bbhd https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23519.yml 38.4.0
2026-04-16T22:17:55.954180+00:00 GitLab Importer Affected by VCID-63em-3vdj-j3cu https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23517.yml 38.4.0
2026-04-16T22:04:41.981744+00:00 GitLab Importer Affected by VCID-ete9-xwuw-puf8 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-32209.yml 38.4.0
2026-04-16T20:42:25.290074+00:00 GitLab Importer Affected by VCID-xby9-avva-a3e5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2018-3741.yml 38.4.0
2026-04-16T20:33:26.239203+00:00 GitLab Importer Affected by VCID-nc6s-6usd-gkeb https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7578.yml 38.4.0
2026-04-16T20:33:26.185528+00:00 GitLab Importer Affected by VCID-2ece-9xu2-z7ea https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7580.yml 38.4.0
2026-04-16T20:33:25.557862+00:00 GitLab Importer Affected by VCID-ujza-s7ug-9fcp https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7579.yml 38.4.0
2026-04-16T17:41:14.663411+00:00 Ruby Importer Affected by VCID-ueen-aybd-tqh2 https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53986.yml 38.4.0
2026-04-16T17:41:14.605131+00:00 Ruby Importer Affected by VCID-rz3c-6h7r-6bam https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53988.yml 38.4.0
2026-04-16T17:41:14.544926+00:00 Ruby Importer Affected by VCID-rhb1-h2b8-jucb https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53987.yml 38.4.0
2026-04-16T17:41:14.482726+00:00 Ruby Importer Affected by VCID-cphr-tdzs-x7ar https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53985.yml 38.4.0
2026-04-16T17:41:14.417940+00:00 Ruby Importer Affected by VCID-apxn-up79-x3ge https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53989.yml 38.4.0
2026-04-16T01:23:01.226098+00:00 GHSA Importer Affected by VCID-6158-4ade-h7ba https://github.com/advisories/GHSA-77pc-q5q7-qg9h 38.4.0
2026-04-16T01:23:01.168286+00:00 GHSA Importer Affected by VCID-an3h-1c9y-f3bp https://github.com/advisories/GHSA-mrhj-2g4v-39qx 38.4.0
2026-04-16T01:22:59.964114+00:00 GHSA Importer Affected by VCID-327c-vdne-j7ar https://github.com/advisories/GHSA-qc8j-m8j3-rjq6 38.4.0
2026-04-11T23:35:39.284300+00:00 GitLab Importer Affected by VCID-zcs7-hzze-u3a5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23520.yml 38.3.0
2026-04-11T23:35:31.323754+00:00 GitLab Importer Affected by VCID-782b-usu3-bbhd https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23519.yml 38.3.0
2026-04-11T23:35:26.283926+00:00 GitLab Importer Affected by VCID-63em-3vdj-j3cu https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23517.yml 38.3.0
2026-04-11T23:20:29.802798+00:00 GitLab Importer Affected by VCID-ete9-xwuw-puf8 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-32209.yml 38.3.0
2026-04-11T21:53:00.870921+00:00 GitLab Importer Affected by VCID-xby9-avva-a3e5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2018-3741.yml 38.3.0
2026-04-11T21:43:50.743686+00:00 GitLab Importer Affected by VCID-nc6s-6usd-gkeb https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7578.yml 38.3.0
2026-04-11T21:43:50.684035+00:00 GitLab Importer Affected by VCID-2ece-9xu2-z7ea https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7580.yml 38.3.0
2026-04-11T21:43:49.975193+00:00 GitLab Importer Affected by VCID-ujza-s7ug-9fcp https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7579.yml 38.3.0
2026-04-11T21:38:51.518808+00:00 Ruby Importer Affected by VCID-ueen-aybd-tqh2 https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53986.yml 38.3.0
2026-04-11T21:38:51.410177+00:00 Ruby Importer Affected by VCID-rz3c-6h7r-6bam https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53988.yml 38.3.0
2026-04-11T21:38:51.300974+00:00 Ruby Importer Affected by VCID-rhb1-h2b8-jucb https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53987.yml 38.3.0
2026-04-11T21:38:51.190754+00:00 Ruby Importer Affected by VCID-cphr-tdzs-x7ar https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53985.yml 38.3.0
2026-04-11T21:38:51.070759+00:00 Ruby Importer Affected by VCID-apxn-up79-x3ge https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53989.yml 38.3.0
2026-04-11T12:52:22.479586+00:00 GHSA Importer Affected by VCID-6158-4ade-h7ba https://github.com/advisories/GHSA-77pc-q5q7-qg9h 38.3.0
2026-04-11T12:52:22.423442+00:00 GHSA Importer Affected by VCID-an3h-1c9y-f3bp https://github.com/advisories/GHSA-mrhj-2g4v-39qx 38.3.0
2026-04-11T12:52:21.237974+00:00 GHSA Importer Affected by VCID-327c-vdne-j7ar https://github.com/advisories/GHSA-qc8j-m8j3-rjq6 38.3.0
2026-04-02T23:40:15.148699+00:00 GitLab Importer Affected by VCID-zcs7-hzze-u3a5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23520.yml 38.1.0
2026-04-02T23:40:09.197289+00:00 GitLab Importer Affected by VCID-782b-usu3-bbhd https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23519.yml 38.1.0
2026-04-02T23:40:04.687054+00:00 GitLab Importer Affected by VCID-63em-3vdj-j3cu https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23517.yml 38.1.0
2026-04-02T23:27:38.938341+00:00 GitLab Importer Affected by VCID-ete9-xwuw-puf8 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-32209.yml 38.1.0
2026-04-02T22:06:47.122657+00:00 GitLab Importer Affected by VCID-xby9-avva-a3e5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2018-3741.yml 38.1.0
2026-04-02T21:57:58.597961+00:00 GitLab Importer Affected by VCID-nc6s-6usd-gkeb https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7578.yml 38.1.0
2026-04-02T21:57:58.544171+00:00 GitLab Importer Affected by VCID-2ece-9xu2-z7ea https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7580.yml 38.1.0
2026-04-02T21:57:57.917787+00:00 GitLab Importer Affected by VCID-ujza-s7ug-9fcp https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7579.yml 38.1.0
2026-04-02T19:36:39.866674+00:00 Ruby Importer Affected by VCID-ueen-aybd-tqh2 https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53986.yml 38.1.0
2026-04-02T19:36:39.806303+00:00 Ruby Importer Affected by VCID-rz3c-6h7r-6bam https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53988.yml 38.1.0
2026-04-02T19:36:39.745241+00:00 Ruby Importer Affected by VCID-rhb1-h2b8-jucb https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53987.yml 38.1.0
2026-04-02T19:36:39.685648+00:00 Ruby Importer Affected by VCID-cphr-tdzs-x7ar https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53985.yml 38.1.0
2026-04-02T19:36:39.606950+00:00 Ruby Importer Affected by VCID-apxn-up79-x3ge https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53989.yml 38.1.0
2026-04-02T13:45:14.585348+00:00 GHSA Importer Affected by VCID-6158-4ade-h7ba https://github.com/advisories/GHSA-77pc-q5q7-qg9h 38.1.0
2026-04-02T13:45:14.546368+00:00 GHSA Importer Affected by VCID-an3h-1c9y-f3bp https://github.com/advisories/GHSA-mrhj-2g4v-39qx 38.1.0
2026-04-02T13:45:13.967354+00:00 GHSA Importer Affected by VCID-327c-vdne-j7ar https://github.com/advisories/GHSA-qc8j-m8j3-rjq6 38.1.0
2026-04-01T18:02:46.232922+00:00 GitLab Importer Affected by VCID-zcs7-hzze-u3a5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23520.yml 38.0.0
2026-04-01T18:02:39.952591+00:00 GitLab Importer Affected by VCID-782b-usu3-bbhd https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23519.yml 38.0.0
2026-04-01T18:02:34.518261+00:00 GitLab Importer Affected by VCID-63em-3vdj-j3cu https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-23517.yml 38.0.0
2026-04-01T17:48:41.163797+00:00 GitLab Importer Affected by VCID-ete9-xwuw-puf8 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2022-32209.yml 38.0.0
2026-04-01T16:23:48.852837+00:00 GitLab Importer Affected by VCID-xby9-avva-a3e5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2018-3741.yml 38.0.0
2026-04-01T16:15:10.519812+00:00 GitLab Importer Affected by VCID-nc6s-6usd-gkeb https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7578.yml 38.0.0
2026-04-01T16:15:10.457375+00:00 GitLab Importer Affected by VCID-2ece-9xu2-z7ea https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7580.yml 38.0.0
2026-04-01T15:56:41.147061+00:00 GHSA Importer Affected by VCID-an3h-1c9y-f3bp https://github.com/advisories/GHSA-mrhj-2g4v-39qx 38.0.0
2026-04-01T15:53:58.857592+00:00 Ruby Importer Affected by VCID-ueen-aybd-tqh2 https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53986.yml 38.0.0
2026-04-01T15:53:58.746601+00:00 Ruby Importer Affected by VCID-rz3c-6h7r-6bam https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53988.yml 38.0.0
2026-04-01T15:53:58.628482+00:00 Ruby Importer Affected by VCID-rhb1-h2b8-jucb https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53987.yml 38.0.0
2026-04-01T15:53:58.519337+00:00 Ruby Importer Affected by VCID-cphr-tdzs-x7ar https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53985.yml 38.0.0
2026-04-01T15:53:58.402737+00:00 Ruby Importer Affected by VCID-apxn-up79-x3ge https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53989.yml 38.0.0
2026-04-01T13:03:42.602003+00:00 GithubOSV Importer Affected by VCID-an3h-1c9y-f3bp https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/09/GHSA-mrhj-2g4v-39qx/GHSA-mrhj-2g4v-39qx.json 38.0.0
2026-04-01T12:47:00.712452+00:00 GitLab Importer Affected by VCID-ujza-s7ug-9fcp https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/rails-html-sanitizer/CVE-2015-7579.yml 38.0.0