Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 552326 (CVE-2015-1840) - <dev-ruby/jquery-rails-{3.1.3:3,4.0.4:4}: CSRF (CVE-2015-1840)
Summary: <dev-ruby/jquery-rails-{3.1.3:3,4.0.4:4}: CSRF (CVE-2015-1840)
Status: RESOLVED FIXED
Alias: CVE-2015-1840
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Security
URL: https://groups.google.com/forum/#!top...
Whiteboard: ~4 [noglsa cve]
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-16 20:08 UTC by Hans de Graaff
Modified: 2015-07-05 21:56 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans de Graaff gentoo-dev Security 2015-06-16 20:08:02 UTC
CSRF Vulnerability in jquery-ujs and jquery-rails

There is 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.

This vulnerability has been assigned the CVE identifier CVE-2015-1840.

Versions Affected:  All.
Not affected:       Applications which don't use jquery-ujs or jquery-rails.
Fixed Versions:     jquery-rails versions 4.0.4 and 3.1.3 and jquery-ujs 1.0.4.

Impact
------
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.

Releases
--------
The FIXED releases are available at the normal locations.

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
-------
To aid users who aren't able to upgrade immediately we have provided patches for the
supported release series. They are in git-am format and consist of a single changeset.

* 1-0-3-jquery_ujs_csrf.patch - Patch for jquery-ujs 1.0.3.

* 3-1-2-jquery-rails-csrf.patch - Patch for jquery-rails 3.1.2.
* 4-0-3-jquery-rails-csrf.patch - Patch for jquery-rails 4.0.3.

Credits
-------

Thanks to Ben Toews of GitHub for reporting the vulnerability to us, and working with us on a fix.
Comment 1 Hans de Graaff gentoo-dev Security 2015-06-16 20:13:59 UTC
dev-ruby/jquery-rails-3.1.3 and dev-ruby/jquery-rails-4.0.4 are now in the gentoo tree.

dev-ruby/jquery-rails:2 is not mentioned in the CVE but assumed to be vulnerable as well. It will be masked for removal along with dev-ruby/best_in_place-2.1.0 which still depends on it. We still have a pending version bump for best_in_place that should probably be done first.
Comment 2 Manuel Rüger (RETIRED) gentoo-dev 2015-07-04 10:55:28 UTC
I removed vulnerable versions for slot :3 and :4. Still waiting for :2
Comment 3 Hans de Graaff gentoo-dev Security 2015-07-04 19:49:00 UTC
best_in_place-3.0.3 is now in the tree. Nothing in the tree depends on it, so I've removed the old version right away.
Comment 4 Manuel Rüger (RETIRED) gentoo-dev 2015-07-04 20:38:26 UTC
Security: Please ack, that no glsa is needed (no stable) and mark as resolved.