Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 2 Jan 2013 13:22:22 -0800
From: Aaron Patterson <tenderlove@...y-lang.org>
To: rubyonrails-security@...glegroups.com, oss-security@...ts.openwall.com
Subject: SQL Injection Vulnerability in Ruby on Rails (CVE-2012-5664)

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

Versions Affected:  All.
Not affected:       NONE.
Fixed Versions:     3.2.10, 3.1.9, 3.0.18

Impact 
------ 
Due to the way dynamic finders in Active Record extract options from method parameters, a method parameter can mistakenly be used as a scope.  Carefully crafted requests can use the scope to inject arbitrary SQL.

All users running an affected release should either upgrade or use one of the work arounds immediately. 

Impacted code passes user provided data to a dynamic finder like this:

  Post.find_by_id(params[:id])

Releases 
-------- 
The  3.2.10, 3.1.9 & 3.0.18 releases are available at the normal locations. 

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

  Post.find_by_id(params[:id])

to this:

  Post.find_by_id(params[:id].to_s)


Patches 
------- 
To aid users who aren't able to upgrade immediately we have provided patches for the two supported release series and two unsupported versions.  They are in git-am format and consist of a single changeset. 

* 3-2-dynamic_finder_injection.patch - Patch for 3.2 series
* 3-1-dynamic_finder_injection.patch - Patch for 3.1 series
* 3-0-dynamic_finder_injection.patch - Patch for 3.0 series
* 2-3-dynamic_finder_injection.patch - Patch for 2.3 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.

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

View attachment "2-3-dynamic_finder_injection.patch" of type "text/plain" (2085 bytes)

View attachment "3-0-dynamic_finder_injection.patch" of type "text/plain" (2201 bytes)

View attachment "3-1-dynamic_finder_injection.patch" of type "text/plain" (2155 bytes)

View attachment "3-2-dynamic_finder_injection.patch" of type "text/plain" (2153 bytes)

Powered by blists - more mailing lists

Your e-mail address:

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Powered by Openwall GNU/*/Linux - Powered by OpenVZ