Bug 1233334 (CVE-2015-1840) - CVE-2015-1840 rubygem-jquery-rails: CSRF Vulnerability in jquery-ujs and jquery-rails
Summary: CVE-2015-1840 rubygem-jquery-rails: CSRF Vulnerability in jquery-ujs and jque...
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2015-1840
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1233336 1233337 1233338
Blocks: 1250027
TreeView+ depends on / blocked
 
Reported: 2015-06-18 16:19 UTC by Vasyl Kaigorodov
Modified: 2023-05-12 22:31 UTC (History)
34 users (show)

Fixed In Version: rubygem-jquery-rails 3.1.3,rubygem-jquery-rails 4.0.4
Clone Of:
Environment:
Last Closed: 2015-08-07 07:00:27 UTC
Embargoed:


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

Description Vasyl Kaigorodov 2015-06-18 16:19:29 UTC
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 16:20:10 UTC
Created attachment 1040569 [details]
3-1-2-jquery-rails-csrf.patch

Comment 2 Vasyl Kaigorodov 2015-06-18 16:20:35 UTC
Created attachment 1040577 [details]
4-0-3-jquery-rails-csrf.patch

Comment 4 Vasyl Kaigorodov 2015-06-18 16:21:20 UTC
Created rubygem-jquery-rails tracking bugs for this issue:

Affects: fedora-all [bug 1233336]

Comment 5 Fedora Update System 2015-06-30 00:04:11 UTC
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-30 00:18:07 UTC
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 06:58:34 UTC
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.