CVE-2013-3221 Active Record component in Ruby on Rails has a data-type injection vulnerability
Remote attackers can manipulate database queries via crafted input in Ruby on Rails applications, potentially reading or modifying data.
- Exploited in the wild
- Not known
- Login needed
- Not stated
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2013-3221?
CVE-2013-3221 is a medium-severity SQL injection vulnerability in Rubyonrails Rails, published on 22 Apr 2013. It can be exploited over the network, with no action from the victim.
Official description
The Active Record component in Ruby on Rails 2.3.x, 3.0.x, 3.1.x, and 3.2.x does not ensure that the declared data type of a database column is used during comparisons of input values to stored values in that column, which makes it easier for remote attackers to conduct data-type injection attacks against Ruby on Rails applications via a crafted value, as demonstrated by unintended interaction between the "typed XML" feature and a MySQL database.
Weakness: CWE-20
Which versions are affected by CVE-2013-3221?
2 open source packages ship an affected version, including activerecord. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
activerecord RubyGems | All versions | 4.2.0 |
activerecord RubyGems | All versions | 4.2.0 |
Products include Rubyonrails Rails, Rubyonrails Ruby on Rails.
How do I fix CVE-2013-3221?
Upgrade activerecord to 4.2.0 or later.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2013-3221 being exploited?
There is no known exploitation of CVE-2013-3221 in the wild and no public exploit code.
Other vulnerabilities in Rubyonrails Rails
- CVE-2013-0277 Active Record contains deserialization of arbitrary YAML
- CVE-2017-17916 SQL injection in n/a
- CVE-2017-17917 SQL injection in n/a
- CVE-2026-33195 Rails Active Storage has possible Path Traversal in DiskService
- CVE-2024-26142 Rails possible ReDoS vulnerability in Accept header parsing in Action Dispatch
Sources
Also known as DEBIAN-CVE-2013-3221, GHSA-f57c-hx33-hvh8.