CWE
89
Advisory Published
CVE Published
Updated

CVE-2012-2661: SQL Injection

First published: Fri Jun 01 2012(Updated: )

A security flaw was found in the way rubygem-activerecord, the ActiveRecord pattern for ORM, performed SQL query generation based on the content of params hash, when nested query paramaters were provided. If a Ruby on Rails application directly passed request params to the 'where' method of an ActiveRecord class, a remote attacker could use this flaw to cause the 'params[:id]' to return a specially-crafted hash, resulting into the WHERE clause of the SQL statement to query an arbitrary table with value of attacker's choice, leading to disclosure of sensitive information. Upstream advisory announcement: [1] <a href="http://groups.google.com/group/rubyonrails-security/browse_thread/thread/7546a238e1962f59">http://groups.google.com/group/rubyonrails-security/browse_thread/thread/7546a238e1962f59</a> Relevant patches: [2] <a href="http://groups.google.com/group/rubyonrails-security/attach/fc2da6c627fc92df/3-0-params_sql_injection.patch?part=3">http://groups.google.com/group/rubyonrails-security/attach/fc2da6c627fc92df/3-0-params_sql_injection.patch?part=3</a> (against v3.0 branch) [3] <a href="http://groups.google.com/group/rubyonrails-security/attach/fc2da6c627fc92df/3-1-params_sql_injection.patch?part=4">http://groups.google.com/group/rubyonrails-security/attach/fc2da6c627fc92df/3-1-params_sql_injection.patch?part=4</a> (against v3.1 branch) [4] <a href="http://groups.google.com/group/rubyonrails-security/attach/fc2da6c627fc92df/3-2-params_sql_injection.patch?part=5">http://groups.google.com/group/rubyonrails-security/attach/fc2da6c627fc92df/3-2-params_sql_injection.patch?part=5</a> (against v3.2 branch)

Credit: secalert@redhat.com

Affected SoftwareAffected VersionHow to fix
redhat/rubygem-actionpack<3.0.13
3.0.13
redhat/rubygem-actionpack<3.1.5
3.1.5
redhat/rubygem-actionpack<3.2.4
3.2.4
rubyonrails Rails=3.0.0
rubyonrails Rails=3.0.0-beta
rubyonrails Rails=3.0.0-beta2
rubyonrails Rails=3.0.0-beta3
rubyonrails Rails=3.0.0-beta4
rubyonrails Rails=3.0.0-rc
rubyonrails Rails=3.0.0-rc2
rubyonrails Rails=3.0.1
rubyonrails Rails=3.0.1-pre
rubyonrails Rails=3.0.2
rubyonrails Rails=3.0.2-pre
rubyonrails Rails=3.0.3
rubyonrails Rails=3.0.4-rc1
rubyonrails Rails=3.0.5
rubyonrails Rails=3.0.5-rc1
rubyonrails Rails=3.0.6
rubyonrails Rails=3.0.6-rc1
rubyonrails Rails=3.0.6-rc2
rubyonrails Rails=3.0.7
rubyonrails Rails=3.0.7-rc1
rubyonrails Rails=3.0.7-rc2
rubyonrails Rails=3.0.8
rubyonrails Rails=3.0.8-rc1
rubyonrails Rails=3.0.8-rc2
rubyonrails Rails=3.0.8-rc3
rubyonrails Rails=3.0.8-rc4
rubyonrails Rails=3.0.9
rubyonrails Rails=3.0.9-rc1
rubyonrails Rails=3.0.9-rc2
rubyonrails Rails=3.0.9-rc3
rubyonrails Rails=3.0.9-rc4
rubyonrails Rails=3.0.9-rc5
rubyonrails Rails=3.0.10
rubyonrails Rails=3.0.10-rc1
rubyonrails Rails=3.0.11
rubyonrails Rails=3.0.12
rubyonrails Rails=3.0.12-rc1
rubyonrails Rails=3.0.13-rc1
Ruby on Rails=3.0.4
rubyonrails Rails=3.1.0
rubyonrails Rails=3.1.0-beta1
rubyonrails Rails=3.1.0-rc1
rubyonrails Rails=3.1.0-rc2
rubyonrails Rails=3.1.0-rc3
rubyonrails Rails=3.1.0-rc4
rubyonrails Rails=3.1.0-rc5
rubyonrails Rails=3.1.0-rc6
rubyonrails Rails=3.1.0-rc7
rubyonrails Rails=3.1.0-rc8
rubyonrails Rails=3.1.1
rubyonrails Rails=3.1.1-rc1
rubyonrails Rails=3.1.1-rc2
rubyonrails Rails=3.1.1-rc3
rubyonrails Rails=3.1.2
rubyonrails Rails=3.1.2-rc1
rubyonrails Rails=3.1.2-rc2
rubyonrails Rails=3.1.3
rubyonrails Rails=3.1.4
rubyonrails Rails=3.1.4-rc1
rubyonrails Rails=3.1.5-rc1
rubyonrails Rails=3.2.0
rubyonrails Rails=3.2.0-rc1
rubyonrails Rails=3.2.0-rc2
rubyonrails Rails=3.2.1
rubyonrails Rails=3.2.2
rubyonrails Rails=3.2.2-rc1
rubyonrails Rails=3.2.3
rubyonrails Rails=3.2.3-rc1
rubyonrails Rails=3.2.3-rc2
rubyonrails Rails=3.2.4-rc1

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203