Ruby/actionview/6.0.3
Simple, battle-tested conventions and helpers for building web pages.
https://rubygems.org/gems/actionview
MIT
7 Security Vulnerabilities
XSS in Action View
- https://github.com/rails/rails/security/advisories/GHSA-cfjv-5498-mph5
- https://nvd.nist.gov/vuln/detail/CVE-2020-15169
- https://github.com/advisories/GHSA-cfjv-5498-mph5
- https://github.com/rails/rails/commit/e663f084460ea56c55c3dc76f78c7caeddeeb02e
- https://www.debian.org/security/2020/dsa-4766
- https://lists.debian.org/debian-lts-announce/2020/10/msg00015.html
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XJ7NUWXAEVRQCROIIBV4C6WXO6IR3KSB/
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionview/CVE-2020-15169.yml
- https://groups.google.com/g/rubyonrails-security/c/b-C9kSGXYrc
There is a potential Cross-Site Scripting (XSS) vulnerability in Action View's translation helpers. Views that allow the user to control the default (not found) value of the t
and translate
helpers could be susceptible to XSS attacks.
Impact
When an HTML-unsafe string is passed as the default for a missing translation key named html
or ending in _html
, the default string is incorrectly marked as HTML-safe and not escaped. Vulnerable code may look like the following examples:
<%# The welcome_html translation is not defined for the current locale: %>
<%= t("welcome_html", default: untrusted_user_controlled_string) %>
<%# Neither the title.html translation nor the missing.html translation is defined for the current locale: %>
<%= t("title.html", default: [:"missing.html", untrusted_user_controlled_string]) %>
Patches
Patched Rails versions, 6.0.3.3 and 5.2.4.4, are available from the normal locations.
The patches have also been applied to the master
, 6-0-stable
, and 5-2-stable
branches on GitHub. If you track any of these branches, you should update to the latest.
To aid users who aren’t able to upgrade immediately, we’ve provided patches for the two supported release series. They are in git-am format and consist of a single changeset.
- 5-2-translate-helper-xss.patch — patch for the 5.2 release series
- 6-0-translate-helper-xss.patch — patch for the 6.0 release series
Please note that only the 5.2 and 6.0 release series are currently supported. Users of earlier, unsupported releases are advised to update as soon as possible, as we cannot provide security fixes for unsupported releases.
Workarounds
Impacted users who can’t upgrade to a patched Rails version can avoid this issue by manually escaping default translations with the html_escape
helper (aliased as h
):
<%= t("welcome_html", default: h(untrusted_user_controlled_string)) %>
XSS Vulnerability in Action View tag helpers
- https://nvd.nist.gov/vuln/detail/CVE-2022-27777
- https://github.com/rails/rails/commit/649516ce0feb699ae06a8c5e81df75d460cc9a85
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionview/CVE-2022-27777.yml
- https://groups.google.com/g/ruby-security-ann/c/9wJPEDv-iRw
- https://rubyonrails.org/2022/4/26/Rails-7-0-2-4-6-1-5-1-6-0-4-8-and-5-2-7-1-have-been-released
- https://github.com/advisories/GHSA-ch3h-j2vf-95pv
- https://discuss.rubyonrails.org/t/cve-2022-27777-possible-xss-vulnerability-in-action-view-tag-helpers/80534
- https://lists.debian.org/debian-lts-announce/2022/09/msg00002.html
- https://www.debian.org/security/2023/dsa-5372
There is a possible XSS vulnerability in Action View tag helpers. Passing untrusted input as hash keys can lead to a possible XSS vulnerability. This vulnerability has been assigned the CVE identifier CVE-2022-27777.
Versions Affected: ALL Not affected: NONE Fixed Versions: 7.0.2.4, 6.1.5.1, 6.0.4.8, 5.2.7.1
Impact
If untrusted data is passed as the hash key for tag attributes, there is a possibility that the untrusted data may not be properly escaped which can lead to an XSS vulnerability.
Impacted code will look something like this:
check_box_tag('thename', 'thevalue', false, aria: { malicious_input => 'thevalueofaria' })
Where the malicious_input
variable contains untrusted data.
All users running an affected release should either upgrade or use one of the workarounds immediately.
Releases
The FIXED releases are available at the normal locations.
Workarounds
Escape the untrusted data before using it as a key for tag helper methods.
rails-ujs vulnerable to DOM Based Cross-site Scripting contenteditable HTML Elements
- https://github.com/rails/rails/commit/5037a13614d71727af8a175063bcf6ba1a74bdbd
- https://github.com/rails/rails/commit/73009ea59a811b28e8ec2a9c9bc24635aa891214
- https://discuss.rubyonrails.org/t/cve-2023-23913-dom-based-cross-site-scripting-in-rails-ujs-for-contenteditable-html-elements/82468
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionview/CVE-2023-23913.yml
- https://github.com/advisories/GHSA-xp5h-f8jf-rc8q
NOTE: rails-ujs is part of Rails/actionview since 5.1.0.
There is a potential DOM based cross-site scripting issue in rails-ujs which leverages the Clipboard API to target HTML elements that are assigned the contenteditable attribute. This has the potential to occur when pasting malicious HTML content from the clipboard that includes a data-method, data-remote or data-disable-with attribute.
This vulnerability has been assigned the CVE identifier CVE-2023-23913.
Not affected: < 5.1.0 Versions Affected: >= 5.1.0 Fixed Versions: 6.1.7.3, 7.0.4.3
Impact If the specified malicious HTML clipboard content is provided to a contenteditable element, this could result in the arbitrary execution of javascript on the origin in question.
Releases The FIXED releases are available at the normal locations.
Workarounds We recommend that all users upgrade to one of the FIXED versions. In the meantime, users can attempt to mitigate this vulnerability by removing the contenteditable attribute from elements in pages that rails-ujs will interact with.
Patches To aid users who aren’t able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset.
- rails-ujs-data-method-contenteditable-6-1.patch - Patch for 6.1 series
- rails-ujs-data-method-contenteditable-7-0.patch - Patch for 7.0 series
Please note that only the 7.0.Z and 6.1.Z series are supported at present, and 6.0.Z for severe vulnerabilities.
Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.
Credits We would like to thank ryotak 15 for reporting this!
- rails-ujs-data-method-contenteditable-6-1.patch (8.5 KB)
- rails-ujs-data-method-contenteditable-7-0.patch (8.5 KB)
- rails-ujs-data-method-contenteditable-main.patch (8.9 KB)
CSRF Vulnerability in rails-ujs
- https://nvd.nist.gov/vuln/detail/CVE-2020-8167
- https://github.com/advisories/GHSA-xq5j-gw7f-jgj8
- https://hackerone.com/reports/189878
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionview/CVE-2020-8167.yml
- https://groups.google.com/forum/#!topic/rubyonrails-security/x9DixQDG9a0
- https://groups.google.com/g/rubyonrails-security/c/x9DixQDG9a0
- https://www.debian.org/security/2020/dsa-4766
There is a vulnerability in rails-ujs that allows attackers to send CSRF tokens to wrong domains.
Versions Affected: rails <= 6.0.3 Not affected: Applications which don't use rails-ujs. Fixed Versions: rails >= 5.2.4.3, rails >= 6.0.3.1
Impact
This is a regression of CVE-2015-1840.
In the scenario where an attacker might be able to control the href attribute of an anchor tag or the action attribute of a form tag that will trigger a POST action, the attacker can set the href or action to a cross-origin URL, and the CSRF token will be sent.
Workarounds
To work around this problem, change code that allows users to control the href attribute of an anchor tag or the action attribute of a form tag to filter the user parameters.
For example, code like this:
link_to params
to code like this:
link_to filtered_params
def filtered_params
# Filter just the parameters that you trust
end
Potential XSS vulnerability in Action View
There is a potential Cross-Site Scripting (XSS) vulnerability in Action
View's translation helpers. Views that allow the user to control the
default (not found) value of the t
and translate
helpers could be
susceptible to XSS attacks.
Impact
When an HTML-unsafe string is passed as the default for a missing
translation key named html
or ending in _html
,
the default string is incorrectly marked as HTML-safe and not escaped.
Vulnerable code may look like the following examples:
<%# The welcome_html translation is not defined for the current locale: %>
<%= t("welcome_html", default: untrusted_user_controlled_string) %>
<%# Neither the title.html translation nor the missing.html translation is defined for the current locale: %>
<%= t("title.html", default: [:"missing.html", untrusted_user_controlled_string]) %>
Workarounds
Impacted users who can’t upgrade to a patched Rails version can avoid
this issue by manually escaping default translations with the
html_escape
helper (aliased as h
):
<%= t("welcome_html", default: h(untrusted_user_controlled_string)) %>
CSRF Vulnerability in rails-ujs
There is an vulnerability in rails-ujs that allows attackers to send CSRF tokens to wrong domains.
Versions Affected: rails <= 6.0.3 Not affected: Applications which don't use rails-ujs. Fixed Versions: rails >= 5.2.4.3, rails >= 6.0.3.1
Impact
This is a regression of CVE-2015-1840.
In the scenario where an attacker might be able to control the href attribute of an anchor tag or the action attribute of a form tag that will trigger a POST action, the attacker can set the href or action to a cross-origin URL, and the CSRF token will be sent.
Workarounds
To work around this problem, change code that allows users to control the href attribute of an anchor tag or the action attribute of a form tag to filter the user parameters.
For example, code like this:
link_to params
to code like this:
link_to filtered_params
def filtered_params
# Filter just the parameters that you trust
end
DOM Based Cross-site Scripting in rails-ujs for contenteditable HTML Elements
NOTE: rails-ujs is part of Rails/actionview since 5.1.0.
There is a potential DOM based cross-site scripting issue in rails-ujs which leverages the Clipboard API to target HTML elements that are assigned the contenteditable attribute. This has the potential to occur when pasting malicious HTML content from the clipboard that includes a data-method, data-remote or data-disable-with attribute.
This vulnerability has been assigned the CVE identifier CVE-2023-23913.
Not affected: < 5.1.0 Versions Affected: >= 5.1.0 Fixed Versions: 6.1.7.3, 7.0.4.3
Impact If the specified malicious HTML clipboard content is provided to a contenteditable element, this could result in the arbitrary execution of javascript on the origin in question.
Releases The FIXED releases are available at the normal locations.
Workarounds We recommend that all users upgrade to one of the FIXED versions. In the meantime, users can attempt to mitigate this vulnerability by removing the contenteditable attribute from elements in pages that rails-ujs will interact with.
Patches To aid users who aren’t able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset.
- rails-ujs-data-method-contenteditable-6-1.patch - Patch for 6.1 series
- rails-ujs-data-method-contenteditable-7-0.patch - Patch for 7.0 series
Please note that only the 7.0.Z and 6.1.Z series are supported at present, and 6.0.Z for severe vulnerabilities.
Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.
Credits We would like to thank ryotak 15 for reporting this!
- rails-ujs-data-method-contenteditable-6-1.patch (8.5 KB)
- rails-ujs-data-method-contenteditable-7-0.patch (8.5 KB)
- rails-ujs-data-method-contenteditable-main.patch (8.9 KB)
268 Other Versions
Version | License | Security | Released | |
---|---|---|---|---|
4.2.7.1 | MIT | 11 | 2016-08-11 - 17:32 | about 8 years |
4.2.7 | MIT | 12 | 2016-07-13 - 02:55 | about 8 years |
4.2.7.rc1 | MIT | 12 | 2016-07-01 - 00:31 | about 8 years |
4.2.6 | MIT | 12 | 2016-03-07 - 22:32 | over 8 years |
4.2.6.rc1 | MIT | 12 | 2016-03-01 - 18:37 | over 8 years |
4.2.5.2 | MIT | 12 | 2016-02-29 - 19:16 | over 8 years |
4.2.5.1 | MIT | 12 | 2016-01-25 - 19:24 | over 8 years |
4.2.5 | MIT | 14 | 2015-11-12 - 17:06 | almost 9 years |
4.2.5.rc2 | MIT | 14 | 2015-11-05 - 03:01 | almost 9 years |
4.2.5.rc1 | MIT | 14 | 2015-10-30 - 20:47 | almost 9 years |
4.2.4 | MIT | 14 | 2015-08-24 - 18:25 | about 9 years |
4.2.4.rc1 | MIT | 14 | 2015-08-14 - 15:19 | about 9 years |
4.2.3 | MIT | 14 | 2015-06-25 - 21:29 | over 9 years |
4.2.3.rc1 | MIT | 14 | 2015-06-22 - 14:22 | over 9 years |
4.2.2 | MIT | 14 | 2015-06-16 - 18:02 | over 9 years |
4.2.1 | MIT | 14 | 2015-03-19 - 16:41 | over 9 years |
4.2.1.rc4 | MIT | 14 | 2015-03-12 - 21:25 | over 9 years |
4.2.1.rc3 | MIT | 14 | 2015-03-02 - 21:34 | over 9 years |
4.2.1.rc2 | MIT | 14 | 2015-02-25 - 22:18 | over 9 years |
4.2.1.rc1 | MIT | 14 | 2015-02-20 - 22:20 | over 9 years |
4.2.0 | MIT | 14 | 2014-12-20 - 00:15 | almost 10 years |
4.2.0.rc3 | MIT | 13 | 2014-12-13 - 02:58 | almost 10 years |
4.2.0.rc2 | MIT | 13 | 2014-12-05 - 23:19 | almost 10 years |
4.2.0.rc1 | MIT | 13 | 2014-11-28 - 17:52 | almost 10 years |
4.2.0.beta4 | MIT | 13 | 2014-10-30 - 22:12 | almost 10 years |
4.2.0.beta3 | MIT | 13 | 2014-10-30 - 18:49 | almost 10 years |
4.2.0.beta2 | MIT | 13 | 2014-09-26 - 17:44 | about 10 years |
4.2.0.beta1 | MIT | 13 | 2014-08-20 - 02:34 | about 10 years |
4.1.16 | MIT | 15 | 2016-07-12 - 22:20 | about 8 years |
4.1.16.rc1 | MIT | 15 | 2016-07-02 - 02:14 | about 8 years |
4.1.15 | MIT | 15 | 2016-03-07 - 22:36 | over 8 years |
4.1.15.rc1 | MIT | 15 | 2016-03-01 - 18:42 | over 8 years |
4.1.14.2 | MIT | 15 | 2016-02-29 - 19:18 | over 8 years |
4.1.14.1 | MIT | 17 | 2016-01-25 - 19:23 | over 8 years |
4.1.14 | MIT | 19 | 2015-11-12 - 17:20 | almost 9 years |
4.1.14.rc2 | MIT | 19 | 2015-11-05 - 02:54 | almost 9 years |
4.1.14.rc1 | MIT | 19 | 2015-10-30 - 20:45 | almost 9 years |
4.1.13 | MIT | 19 | 2015-08-24 - 18:00 | about 9 years |
4.1.13.rc1 | MIT | 19 | 2015-08-14 - 15:12 | about 9 years |
4.1.12 | MIT | 19 | 2015-06-25 - 21:25 | over 9 years |
4.1.12.rc1 | MIT | 19 | 2015-06-22 - 14:04 | over 9 years |
4.1.11 | MIT | 19 | 2015-06-16 - 17:59 | over 9 years |
4.1.10 | MIT | 19 | 2015-03-19 - 16:49 | over 9 years |
4.1.10.rc4 | MIT | 19 | 2015-03-12 - 21:32 | over 9 years |
4.1.10.rc3 | MIT | 19 | 2015-03-02 - 21:39 | over 9 years |
4.1.10.rc2 | MIT | 19 | 2015-02-25 - 22:21 | over 9 years |
4.1.10.rc1 | MIT | 19 | 2015-02-20 - 22:24 | over 9 years |
4.1.9 | MIT | 19 | 2015-01-06 - 20:03 | over 9 years |
4.1.9.rc1 | MIT | 19 | 2015-01-02 - 01:10 | over 9 years |
4.1.8 | MIT | 19 | 2014-11-17 - 15:59 | almost 10 years |
4.1.7.1 | MIT | 19 | 2014-11-19 - 19:11 | almost 10 years |
4.1.7 | MIT | 19 | 2014-10-30 - 18:49 | almost 10 years |
4.1.6 | MIT | 19 | 2014-09-11 - 17:25 | about 10 years |
4.1.6.rc2 | MIT | 19 | 2014-09-08 - 18:12 | about 10 years |
4.1.6.rc1 | MIT | 19 | 2014-08-19 - 20:52 | about 10 years |
4.1.5 | MIT | 19 | 2014-08-18 - 17:00 | about 10 years |
4.1.4 | MIT | 19 | 2014-07-02 - 19:52 | about 10 years |
4.1.3 | MIT | 19 | 2014-07-02 - 17:05 | about 10 years |
4.1.2 | MIT | 19 | 2014-06-26 - 14:49 | over 10 years |
4.1.2.rc3 | MIT | 19 | 2014-06-23 - 17:27 | over 10 years |
4.1.2.rc2 | MIT | 19 | 2014-06-16 - 16:30 | over 10 years |
4.1.2.rc1 | MIT | 19 | 2014-05-27 - 16:12 | over 10 years |
4.1.1 | MIT | 19 | 2014-05-06 - 16:10 | over 10 years |
4.1.0 | MIT | 19 | 2014-04-08 - 19:20 | over 10 years |
4.1.0.rc2 | MIT | 18 | 2014-03-25 - 20:11 | over 10 years |
4.1.0.rc1 | MIT | 18 | 2014-02-18 - 20:58 | over 10 years |
4.1.0.beta2 | MIT | 18 | 2014-02-18 - 18:51 | over 10 years |
4.1.0.beta1 | MIT | 18 | 2013-12-18 - 00:14 | almost 11 years |