GitHub Advisoryadvisory · RubyGems
GHSA-xq5j-gw7f-jgj8 CSRF Vulnerability in rails-ujs
MEDIUM
Official page ↗
- Aliases
- CVE-2020-8167
- Ecosystem
- RubyGems
- Packages
- actionview
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
- Weaknesses
- CWE-352
- Reviewed
- 2020-07-07
Affected packages
• RubyGems actionview: >= 5.0.0, < 5.2.4.3 → fixed in 5.2.4.3
• RubyGems actionview: >= 6.0.0, < 6.0.3.1 → fixed in 6.0.3.1
Description
There is a vulnerability in rails-ujs that allows attackers to send CSRF tokens to wrong domains.
Versions Affected: 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
Related
Alias · CVE (1)
- CVE-2020-8167 A CSRF vulnerability exists in rails <= 6.0.3 rails-ujs module that could allow attackers to send CSRF tokens to wrong domains. vulnerability
Weakness · CWE (1)
- CWE-352 Cross-Site Request Forgery weakness
References
- https://nvd.nist.gov/vuln/detail/CVE-2020-8167 advisory
- https://hackerone.com/reports/189878 web
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionview/CVE-2020-8167.yml web
- https://groups.google.com/forum/#!topic/rubyonrails-security/x9DixQDG9a0 web
- https://groups.google.com/g/rubyonrails-security/c/x9DixQDG9a0 web
- https://www.debian.org/security/2020/dsa-4766 web