CVE-2020-8167: CSRF
A CSRF vulnerability exists in rails <= 6.0.3 rails-ujs module that could allow attackers to send CSRF tokens to wrong domains.
Other sources
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:
linkto params
to code like this:
linkto filteredparams
def filteredparams # Filter just the parameters that you trust end
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the vulnerability ID for the CSRF vulnerability in rails-ujs?
The vulnerability ID for the CSRF vulnerability in rails-ujs is CVE-2020-8167.
What is the affected version of rails-ujs?
The affected version of rails-ujs is <= 6.0.3.
How can attackers exploit the CSRF vulnerability in rails-ujs?
Attackers can exploit the CSRF vulnerability in rails-ujs by sending CSRF tokens to wrong domains.
Which versions of rails fix the CSRF vulnerability in rails-ujs?
The versions rails >= 5.2.4.3 and rails >= 6.0.3.1 fix the CSRF vulnerability in rails-ujs.
What is the impact of the CSRF vulnerability in rails-ujs?
The CSRF vulnerability in rails-ujs can lead to Cross-Site Request Forgery attacks.