Advisory Database
  • Advisories
  • Dependency Scanning
  1. gem
  2. ›
  3. activerecord
  4. ›
  5. CVE-2013-3221

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

May 14, 2022 (updated February 2, 2026)

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.

References

  • github.com/advisories/GHSA-f57c-hx33-hvh8
  • github.com/rails/rails
  • github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2013-3221.yml
  • groups.google.com/group/rubyonrails-security/msg/1f3bc0b88a60c1ce?dmode=source&output=gplain
  • nvd.nist.gov/vuln/detail/CVE-2013-3221
  • web.archive.org/web/20130825191249/http://www.phenoelit.org/blog/archives/2013/02/index.html

Code Behaviors & Features

Detect and mitigate CVE-2013-3221 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 4.2.0

Fixed versions

  • 4.2.0

Solution

Upgrade to version 4.2.0 or above.

Impact 9.1 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-20: Improper Input Validation
  • CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Source file

gem/activerecord/CVE-2013-3221.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 04 Feb 2026 00:37:09 +0000.