Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Ruby on Rails SQL Injection (CVE-2012-2695)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Aaron Patterson  
View profile  
 More options Jun 12 2012, 5:30 pm
From: Aaron Patterson <tenderl...@ruby-lang.org>
Date: Tue, 12 Jun 2012 14:30:29 -0700
Local: Tues, Jun 12 2012 5:30 pm
Subject: Ruby on Rails SQL Injection (CVE-2012-2695)

SQL Injection Vulnerability in Ruby on Rails

There is a SQL injection vulnerability in Active Record, in ALL versions. This vulnerability has been assigned the CVE identifier CVE-2012-2695.

Versions Affected:  ALL versions
Not affected:       NONE
Fixed Versions:     3.2.6, 3.1.6, 3.0.14

Impact
------
Due to the way Active Record handles nested query parameters, an attacker can use a specially crafted request to inject some forms of SQL into your application's SQL queries.

All users running an affected release should upgrade immediately. Please note, this vulnerability is a variant of CVE-2012-2661, even if you upgraded to address that issue, you must take action again.

Impacted code directly passes request params to the `where` method of an ActiveRecord class like this:

    Post.where(:id => params[:id]).all

An attacker can make a request that causes `params[:id]` to return a specially crafted hash that will cause the WHERE clause of the SQL statement to query an arbitrary table with some value.

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

Workarounds
-----------
This issue can be mitigated by casting the parameter to an expected value.  For example, change this:

    Post.where(:id => params[:id]).all

to this:

    Post.where(:id => params[:id].to_s).all

Patches
-------
To aid users who aren't able to upgrade immediately we have provided patches for the two supported release series.  They are in git-am format and consist of a single changeset.  We have also provided a patch for the 3.0 series despite the fact it is unmaintained.

* 2-3-sql-injection.patch - Patch for 2.3 series
* 3-0-sql-injection.patch - Patch for 3.0 series
* 3-1-sql-injection.patch - Patch for 3.1 series
* 3-2-sql-injection.patch - Patch for 3.2 series

Please note that only the  3.1.x and 3.2.x series are supported at present.  Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.

Credits
-------

Thanks to Justin Collins of Twitter for the backport to 2.3 and to the
following security researchers who reported the vulnerability and helped
us verify the fixes (in alphabetical order):

  * Ernie Miller
  * Gabriel Quadros
  * Takeshi Terada of Mitsui Bussan Secure Directions, Inc.
  * Tomás D'Stefano

--
Aaron Patterson
http://tenderlovemaking.com/

  2-3-sql-injection.patch
3K Download

  3-0-sql-injection.patch
2K Download

  3-1-sql-injection.patch
2K Download

  3-2-sql-injection.patch
2K Download

  application_pgp-signature_part
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »