CVE-2012-2694: Medium severity rubyonrails Rails vulnerability

Published Jun 13, 2012
·
Updated

actionpack/lib/actiondispatch/http/request.rb in Ruby on Rails before 3.0.14, 3.1.x before 3.1.6, and 3.2.x before 3.2.6 does not properly consider differences in parameter handling between the Active Record component and the Rack interface, which allows remote attackers to bypass intended database-query restrictions and perform NULL checks via a crafted request, as demonstrated by certain ['xyz', nil] values, a related issue to CVE-2012-2660.

Other sources

actionpack/lib/actiondispatch/http/request.rb in Ruby on Rails before 3.0.14, 3.1.x before 3.1.6, and 3.2.x before 3.2.6 does not properly consider differences in parameter handling between the Active Record component and the Rack interface, which allows remote attackers to bypass intended database-query restrictions and perform NULL checks via a crafted request, as demonstrated by certain "['xyz', nil]" values, a related issue to CVE-2012-2660.

Originally the CVE identifier of CVE-2012-2660 has been assigned to the following issue:

A security flaw was found in the way rubygem-actionpack, the web-flow and rendering framework putting the VC in MVC, performed SQL query generation based on the content of params hash. If a Ruby on Rails application used Rack to parse query parameters, those parameters were not sanitized for the presence of the 'nil' value and that application relied, when performing user authentication, certain params value not to be 'nil', a remote attacker could use this flaw to bypass the authentication, leading to information disclosure and / or unauthorized access to the service. (bug 827353)

Recently (2012-06-12) it has been reported: [1] https://groups.google.com/group/rubyonrails-security/browsethread/thread/8c82d9df8b401c5e

that there still exists a variant of this attack, which is possible to exploit even the upstream patch for the original CVE-2012-2660 issue has been applied. More from [1]:

--

Due to the way Active Record interprets parameters in combination with the way that Rack parses query parameters, it is possible for an attacker to issue unexpected database queries with "IS NULL" where clauses. This issue does not let an attacker insert arbitrary values into an SQL query, however they can cause the query to check for NULL where most users wouldn't expect it.

For example, a system has password reset with token functionality:

unless params[:token].nil? user = User.findbytoken(params[:token]) user.resetpassword! end

An attacker can craft a request such that params[:token] will return ['xyz', nil]. The ['xyz', nil] value will bypass the test for nil, but will still add an "IN ('xyz', NULL)" clause to the SQL query.

All users running an affected release should either upgrade or use one of the work arounds immediately. All users running an affected release should upgrade immediately. Please note, this vulnerability is a variant of CVE-2012-2660, even if you upgraded to address that issue, you must take action again.

--

Upstream patches: [2] https://groups.google.com/group/rubyonrails-security/attach/e2d3a87f2c211def/3-0-nullarrayparam.patch?part=3 (against v3.0 branch) [3] https://groups.google.com/group/rubyonrails-security/attach/e2d3a87f2c211def/3-1-nullarrayparam.patch?part=4 (against v3.1 branch) [4] https://groups.google.com/group/rubyonrails-security/attach/e2d3a87f2c211def/3-2-nullarrayparam.patch?part=5 (against v3.2 branch)

Affected Software

80 affected componentsFixes available
redhat/rubygem-actionpack<3.2.6
3.2.6
redhat/rubygem-actionpack<3.1.6
3.1.6
redhat/rubygem-actionpack<3.0.14
3.0.14
rubygems/actionpack>=3.0.13<3.0.14
3.0.14
rubygems/actionpack>=3.2.0<3.2.6
3.2.6
rubygems/actionpack>=3.1.0<3.1.6
3.1.6
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
rubyonrails ruby on Rails<=3.0.13
rubyonrails 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
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
rubyonrails Rails=3.2.4-rc1
rubyonrails Rails=3.2.5

Event History

Jun 22, 2012
CVE Published
via MITRE·02:00 PM
Data Sourced
via MITRE·02:00 PM
Description
Oct 24, 2017
Advisory Published
via GitHub·06:33 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2012-2694?

CVE-2012-2694 has a CVSS score indicating a medium severity vulnerability that could allow remote attackers to bypass intended database access controls.

2

How do I fix CVE-2012-2694?

To mitigate CVE-2012-2694, upgrade Ruby on Rails to versions 3.2.6, 3.1.6, or 3.0.14 and later.

3

Which versions of Ruby on Rails are affected by CVE-2012-2694?

CVE-2012-2694 affects Ruby on Rails versions before 3.0.14, 3.1.x before 3.1.6, and 3.2.x before 3.2.6.

4

What type of attacks can exploit CVE-2012-2694?

CVE-2012-2694 allows remote attackers to bypass database access controls by exploiting weaknesses in parameter handling.

5

Is CVE-2012-2694 relevant for my application?

If your application uses Ruby on Rails version prior to the secure releases mentioned, it is vulnerable to CVE-2012-2694.

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.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203