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, 2.3.18
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!
--
Aaron Patterson
http://tenderlovemaking.com/