Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1233334 - (CVE-2015-1840) CVE-2015-1840 rubygem-jquery-rails: CSRF Vulnerability in jquery-ujs and jquery-rails
CVE-2015-1840 rubygem-jquery-rails: CSRF Vulnerability in jquery-ujs and jque...
Status: CLOSED WONTFIX
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20150616,repor...
: Security
Depends On: 1233336 1233337 1233338
Blocks: 1250027
  Show dependency treegraph
 
Reported: 2015-06-18 12:19 EDT by Vasyl Kaigorodov
Modified: 2015-08-14 04:26 EDT (History)
34 users (show)

See Also:
Fixed In Version: rubygem-jquery-rails 3.1.3,rubygem-jquery-rails 4.0.4
Doc Type: Bug Fix
Doc Text:
A flaw was found in the way rubygem-jquery-rails filtered CSRF tokens from HTTP requests. An attacker able to control the href attribute of an anchor tag or the action attribute of a form tag, could use this flaw to force an application to send a request that includes a CSRF token to an attacker-specified site, thus leaking the CSRF token.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-07 03:00:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
3-1-2-jquery-rails-csrf.patch (3.16 KB, text/plain)
2015-06-18 12:20 EDT, Vasyl Kaigorodov
no flags Details
4-0-3-jquery-rails-csrf.patch (3.16 KB, text/plain)
2015-06-18 12:20 EDT, Vasyl Kaigorodov
no flags Details

  None (edit)
Description Vasyl Kaigorodov 2015-06-18 12:19:29 EDT
There's an vulnerability in jquery-ujs and jquery-rails that can be used to bypass CSP protections and allows attackers to send CSRF tokens to attacker domains.

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 " https://attacker.com" (note the leading space) that will be passed to JQuery, who will see this as a same origin request, and send the user's CSRF token to the attacker domain.

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

Patches that fix this issue are attached.
Comment 1 Vasyl Kaigorodov 2015-06-18 12:20:10 EDT
Created attachment 1040569 [details]
3-1-2-jquery-rails-csrf.patch
Comment 2 Vasyl Kaigorodov 2015-06-18 12:20:35 EDT
Created attachment 1040577 [details]
4-0-3-jquery-rails-csrf.patch
Comment 4 Vasyl Kaigorodov 2015-06-18 12:21:20 EDT
Created rubygem-jquery-rails tracking bugs for this issue:

Affects: fedora-all [bug 1233336]
Comment 5 Fedora Update System 2015-06-29 20:04:11 EDT
rubygem-jquery-rails-3.1.0-3.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 6 Fedora Update System 2015-06-29 20:18:07 EDT
rubygem-jquery-rails-3.1.0-3.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 7 Ján Rusnačko 2015-08-07 02:58:34 EDT
Acknowledgements:

Red Hat would like to thank the Ruby on Rails project for reporting this issue.

Note You need to log in before you can comment on or make changes to this bug.