CVE-2013-3221 Active Record component in Ruby on Rails has a data-type injection vulnerability

Medium 6.4 Published Updated

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.

PackageAffectedFixed in
activerecord RubyGemsAll versions4.2.0
activerecord RubyGemsAll versions4.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.

All Rubyonrails Rails vulnerabilities

Sources

Also known as DEBIAN-CVE-2013-3221, GHSA-f57c-hx33-hvh8.

Is CVE-2013-3221 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free