Bug 827353 (CVE-2012-2660)

Summary: CVE-2012-2660 rubygem-actionpack: Unsafe query generation
Product: [Other] Security Response Reporter: Jan Lieskovsky <jlieskov>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: bkabrda, ccoleman, hbrock, lutter, lzap, mastahnke, mmccune, mmorsi, morazi, sseago, tkramer, vanmeeuwen+fedora, vondruch
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rubygem-actionpack 3.0.13, rubygem-actionpack 3.1.5, rubygem-actionpack 3.2.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-26 15:51:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 827364, 829510, 829511    
Bug Blocks: 767033, 836071    

Description Jan Lieskovsky 2012-06-01 08:22:48 UTC
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.

Upstream advisory announcement:
[1] http://groups.google.com/group/rubyonrails-security/browse_thread/thread/f1203e3376acec0f

Relevant patches:
[2] http://groups.google.com/group/rubyonrails-security/attach/d890f8d58b5fbf32/3-0-null_param.patch?part=3
    (against v3.0 branch)
[3] http://groups.google.com/group/rubyonrails-security/attach/d890f8d58b5fbf32/3-1-null_param.patch?part=5
    (against v3.1 branch)
[4] http://groups.google.com/group/rubyonrails-security/attach/d890f8d58b5fbf32/3-2-null_param.patch?part=4
    (against v3.2 branch)

Comment 1 Jan Lieskovsky 2012-06-01 08:42:41 UTC
Further details how to reproduce the problem (from [1]):
--------------------------------------------------------

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

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

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

Comment 2 Jan Lieskovsky 2012-06-01 08:43:57 UTC
This issue affects the versions of the rubygem-actionpack package, as shipped with Fedora release of 15 and 16. Please schedule an update.

--

This issue did NOT affect the version of the rubygem-actionpack package, as shipped with Fedora EPEL 5. The affected functionality is not present there yet.

Comment 3 Jan Lieskovsky 2012-06-01 08:45:11 UTC
Created rubygem-actionpack tracking bugs for this issue

Affects: fedora-all [bug 827364]

Comment 7 Fedora Update System 2012-06-15 00:23:51 UTC
rubygem-actionpack-3.0.11-4.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2012-06-15 00:28:59 UTC
rubygem-actionpack-3.0.10-6.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2012-06-15 12:33:27 UTC
rubygem-actionpack-3.0.5-8.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 errata-xmlrpc 2012-12-04 19:31:14 UTC
This issue has been addressed in following products:

  CloudForms for RHEL 6

Via RHSA-2012:1542 https://rhn.redhat.com/errata/RHSA-2012-1542.html

Comment 11 errata-xmlrpc 2013-01-10 20:42:03 UTC
This issue has been addressed in following products:

  Red Hat Subscription Asset Manager 1.1

Via RHSA-2013:0154 https://rhn.redhat.com/errata/RHSA-2013-0154.html

Comment 12 errata-xmlrpc 2013-02-28 19:06:31 UTC
This issue has been addressed in following products:

  RHEL 6 Version of OpenShift Enterprise

Via RHSA-2013:0582 https://rhn.redhat.com/errata/RHSA-2013-0582.html