CVE-2013-1854: Input Validation
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].tos)
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-attributesymbols.patch - Patch for 3.2 series 3-1-attributesymbols.patch - Patch for 3.1 series 2-3-attributesymbols.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!
Other sources
The Active Record component in Ruby on Rails 2.3.x before 2.3.18, 3.1.x before 3.1.12, and 3.2.x before 3.2.13 processes certain queries by converting hash keys to symbols, which allows remote attackers to cause a denial of service via crafted input to a where method.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2013-1854?
CVE-2013-1854 has a moderate severity level due to its potential for a denial-of-service attack.
How do I fix CVE-2013-1854?
To fix CVE-2013-1854, upgrade Active Record to versions 3.2.13, 3.1.12, or 2.3.18 or later.
Which versions are affected by CVE-2013-1854?
CVE-2013-1854 affects Active Record versions 3.2.x, 3.1.x, and 2.3.x.
Is CVE-2013-1854 applicable to Ruby on Rails 3.0?
No, CVE-2013-1854 does not affect Ruby on Rails version 3.0.
What type of vulnerability is CVE-2013-1854?
CVE-2013-1854 is classified as a symbol denial-of-service (DoS) vulnerability.