Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

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:
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 05:33:22 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: 924316, 924318, 995660, 1030761, 1165368    
Bug Blocks:    
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-14 02:46:43 UTC
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 20:29:36 UTC
Created attachment 710223 [details]
2-3-attribute_symbols.patch

Comment 5 Kurt Seifried 2013-03-14 20:29:57 UTC
Created attachment 710224 [details]
3-1-attribute_symbols.patch

Comment 6 Kurt Seifried 2013-03-14 20:30:18 UTC
Created attachment 710225 [details]
3-2-attribute_symbols.patch

Comment 8 Kurt Seifried 2013-03-16 05:27:15 UTC
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 20:56:58 UTC
Please note that these patches were not affected by the upstream changes.

Comment 11 Vít Ondruch 2013-03-21 14:00:01 UTC
Can I get tracking bug for F18? F17 should not be affected. Thank you.

Comment 12 Jan Lieskovsky 2013-03-21 14:34:45 UTC
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 12:14:30 UTC
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 19:46:21 UTC
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-07 03:05:53 UTC
(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 06:18:32 UTC
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 Prpič 2014-11-14 16:19:25 UTC
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-16 04:17:13 UTC
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 17:08:44 UTC
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