Advisory

GHSA-xq5j-gw7f-jgj8

Also known as: CVE-2020-8167

Summary

CSRF Vulnerability in rails-ujs

Details

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

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2020-07-07 16:34 UTC
Modified
2024-02-16 08:01 UTC

Affected packages and fixes

actionview

RubyGems · All systems

Affected

  • introduced 5.0.0, fixed 5.2.4.3 (ecosystem)

Fixed versions

5.2.4.3

Fix

The export has no generic command for this ecosystem.

actionview

RubyGems · All systems

Affected

  • introduced 6.0.0, fixed 6.0.3.1 (ecosystem)

Fixed versions

6.0.3.1

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences