Bug 921329 (CVE-2013-1854)

Summary: CVE-2013-1854 rubygem-activerecord: attribute_dos Symbol DoS vulnerability
Product: [Other] Security Response Reporter: Kurt Seifried <kseifried>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: athomas, bkabrda, bkearney, bleanhar, ccoleman, cpelland, dajohnso, dmcphers, jeckersb, jialiu, jlieskov, jrusnack, katello-bugs, katello-internal, lmeyer, mastahnke, mmccune, mmcgrath, mmorsi, morazi, msuchy, mtasaka, sclewis, security-response-team, sseago, vanmeeuwen+fedora, vondruch
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: impact=moderate,public=20130318,reported=20130313,source=upstream,cvss2=4.3/AV:N/AC:M/Au:N/C:N/I:N/A:P,fedora-18/rubygem-activerecord=affected,fedora-17/rubygem-activerecord=notaffected,epel-5/rubygem-activerecord=affected,cloudformscommon-1/rubygem-activerecord=wontfix,sam-1/rubygem-activerecord=wontfix,openshift-1/ruby193-rubygem-activerecord=affected,openshift-1/rubygem-activerecord=notaffected,openshift-enterprise-1/ruby193-rubygem-activerecord=wontfix,openshift-enterprise-1/rubygem-activerecord=notaffected,rhn_satellite_6/ruby193-rubygem-activerecord=affected,cwe=CWE-400
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A flaw was found in the way Ruby on Rails handled hashes in certain queries. A remote attacker could use this flaw to perform a denial of service (resource consumption) attack by sending specially crafted queries that would result in the creation of Ruby symbols, which were never garbage collected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-17 00:33:22 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 921350, 921353, 921357, 921359, 924316, 924318, 995660, 1030761, 1165368    
Bug Blocks: 921344, 921347, 921348, 925773, 1000138, 1028279    
Attachments:
Description Flags
2-3-attribute_symbols.patch
none
3-1-attribute_symbols.patch
none
3-2-attribute_symbols.patch none

Description Kurt Seifried 2013-03-13 22:46:43 EDT
Symbol DoS vulnerability in Active Record

There is a symbol DoS vulnerability in Active Record. This vulnerability has been assigned the CVE identifier CVE-2013-1854.

Versions Affected:  3.2.x, 3.1.x, 2.3.x
Not affected:       3.0.x
Fixed Versions:     3.2.13, 3.1.12

Impact 
------ 
When a hash is provided as the find value for a query, the keys of the hash may be converted to symbols.  In this example,

    User.where(:name => { 'foo' => 'bar' })

the string 'foo' will be converted to a symbol.  Impacted code will look something like this:

    User.where(:name => params[:name])

Carefully crafted requests can coerce `params[:name]` to return a hash, and the keys to that hash may be converted to symbols.

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

Releases 
-------- 
The 3.2.13 and 3.1.12 releases are available at the normal locations. 

Workarounds 
----------- 
To work around this problem, change code that looks like this:

    User.where(:name => params[:name])

to code like this:

    User.where(:name => params[:name].to_s)


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. 

* 3-2-attribute_symbols.patch - Patch for 3.2 series
* 3-1-attribute_symbols.patch - Patch for 3.1 series
* 2-3-attribute_symbols.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.

Credits 
------- 

Thanks to Ben Murphy for reporting this!
Comment 4 Kurt Seifried 2013-03-14 16:29:36 EDT
Created attachment 710223 [details]
2-3-attribute_symbols.patch
Comment 5 Kurt Seifried 2013-03-14 16:29:57 EDT
Created attachment 710224 [details]
3-1-attribute_symbols.patch
Comment 6 Kurt Seifried 2013-03-14 16:30:18 EDT
Created attachment 710225 [details]
3-2-attribute_symbols.patch
Comment 8 Kurt Seifried 2013-03-16 01:27:15 EDT
Please note that upstream reports that the patches have an issue and will be reissued this weekend most likely so we might need to respin this fix.
Comment 9 Kurt Seifried 2013-03-19 16:56:58 EDT
Please note that these patches were not affected by the upstream changes.
Comment 11 Vít Ondruch 2013-03-21 10:00:01 EDT
Can I get tracking bug for F18? F17 should not be affected. Thank you.
Comment 12 Jan Lieskovsky 2013-03-21 10:34:45 EDT
Created rubygem-activerecord tracking bugs for this issue

Affects: fedora-18 [bug 924316]
Affects: epel-5 [bug 924318]
Comment 13 Murray McAllister 2013-03-27 08:14:30 EDT
Acknowledgements:

Red Hat would like to thank Ruby on Rails upstream for reporting this issue. Upstream acknowledges Ben Murphy as the original reporter.
Comment 14 errata-xmlrpc 2013-04-02 15:46:21 EDT
This issue has been addressed in following products:

  RHEL 6 Version of OpenShift Enterprise

Via RHSA-2013:0699 https://rhn.redhat.com/errata/RHSA-2013-0699.html
Comment 15 Kurt Seifried 2013-04-06 23:05:53 EDT
(In reply to comment #11)
> Can I get tracking bug for F18? F17 should not be affected. Thank you.


Done, can you mark these as needinfo in future? Thanks.
Comment 16 Kurt Seifried 2013-07-26 02:18:32 EDT
The Red Hat Security Response Team has rated this issue as having moderate security impact in CloudForms 1.1. This issue is not currently planned to be addressed in future updates.
Comment 19 Martin Prpic 2014-11-14 11:19:25 EST
IssueDescription:

A flaw was found in the way Ruby on Rails handled hashes in certain queries. A remote attacker could use this flaw to perform a denial of service (resource consumption) attack by sending specially crafted queries that would result in the creation of Ruby symbols, which were never garbage collected.
Comment 20 Fedora Update System 2014-11-15 23:17:13 EST
rubygem-actionpack-2.3.18-1.el5, rubygem-activerecord-2.3.18-1.el5, rubygem-activesupport-2.3.18-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 21 errata-xmlrpc 2014-11-17 12:08:44 EST
This issue has been addressed in the following products:

  Red Hat Subscription Asset Manager 1.4

Via RHSA-2014:1863 https://rhn.redhat.com/errata/RHSA-2014-1863.html