Skip to content
Noroxi
CVE-2012-6496· NVD / CVE Program· CNA mitre

SQL injection vulnerability in the Active Record component in Ruby on Rails before 3.0.18, 3.1.x before 3.1.9, and 3.2.x before 3.2.10 allow

SQL injection vulnerability in the Active Record component in Ruby on Rails before 3.0.18, 3.1.x before 3.1.9, and 3.2.x before 3.2.10 allows remote attackers to execute arbitrary SQL commands via a crafted request that leverages incorrect behavior of dynamic finders in applications that can use unexpected data types in certain find_by_ method calls.

HighCVSS 7.5 · v2.0—No exploit Fix available
Published
Jan 4, 2013
Updated
Jun 16, 2026
EPSS
4.5% · 91th percentile
Follow this CVE

Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.

Report tools

JSON

Action score

31

Monitor

Low priority for now.

CVSS
30 / 40 · 7.5 / 10
CISA KEV
0 / 30 · Not listed
EPSS
1 / 30 · 4.5%

Affected systems

VendorProduct
rubyonrailsrails
rubyonrailsruby on rails

Affected versions

NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.

  • rubyonrails rails3.0.0
  • rubyonrails rails3.0.1
  • rubyonrails rails3.0.10
  • rubyonrails rails3.0.11
  • rubyonrails rails3.0.12
  • rubyonrails rails3.0.13
  • rubyonrails rails3.0.14
  • rubyonrails rails3.0.16
  • rubyonrails rails3.0.2
  • rubyonrails rails3.0.3
  • rubyonrails rails3.0.4
  • rubyonrails rails3.0.5
  • rubyonrails rails3.0.6
  • rubyonrails rails3.0.7
  • rubyonrails rails3.0.8
  • rubyonrails rails3.0.9
  • rubyonrails rails3.1.0
  • rubyonrails rails3.1.1
  • rubyonrails rails3.1.2
  • rubyonrails rails3.1.3

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
Debian:12railsbefore 2.3.14.12.3.14.1
Debian:6.0railsbefore 2.3.5-1.2+squeeze42.3.5-1.2+squeeze4
Red Hat:openshift:1::el6jenkinsbefore 0:1.498-1.1.el6op0:1.498-1.1.el6op
Red Hat:openshift:1::el6libmongodbbefore 0:2.0.2-6.el6op0:2.0.2-6.el6op
Red Hat:openshift:1::el6mongodbbefore 0:2.0.2-6.el6op0:2.0.2-6.el6op
Red Hat:openshift:1::el6mongodb-debuginfobefore 0:2.0.2-6.el6op0:2.0.2-6.el6op
Red Hat:openshift:1::el6mongodb-develbefore 0:2.0.2-6.el6op0:2.0.2-6.el6op
Red Hat:openshift:1::el6mongodb-serverbefore 0:2.0.2-6.el6op0:2.0.2-6.el6op
Red Hat:openshift:1::el6openshift-consolebefore 0:0.0.13-2.el6op0:0.0.13-2.el6op
Red Hat:openshift:1::el6openshift-origin-brokerbefore 0:1.0.10-1.el6op0:1.0.10-1.el6op
Red Hat:openshift:1::el6openshift-origin-broker-utilbefore 0:1.0.14-1.el6op0:1.0.14-1.el6op
Red Hat:openshift:1::el6openshift-origin-cartridge-haproxy-1.4before 0:1.0.3-1.el6op0:1.0.3-1.el6op
Red Hat:openshift:1::el6openshift-origin-cartridge-ruby-1.8before 0:1.0.5-1.el6op0:1.0.5-1.el6op
Red Hat:openshift:1::el6openshift-origin-cartridge-ruby-1.9-sclbefore 0:1.0.5-1.el6op0:1.0.5-1.el6op
Red Hat:openshift:1::el6openshift-origin-msg-node-mcollectivebefore 0:1.0.2-1.el6op0:1.0.2-1.el6op
Red Hat:openshift:1::el6openshift-origin-node-utilbefore 0:1.0.7-1.el6op0:1.0.7-1.el6op
Red Hat:openshift:1::el6openshift-origin-port-proxybefore 0:1.0.3-1.el6op0:1.0.3-1.el6op
Red Hat:openshift:1::el6rhcbefore 0:1.3.2-1.3.el6op0:1.3.2-1.3.el6op
Red Hat:openshift:1::el6ruby193-mod_passengerbefore 0:3.0.12-21.el6op0:3.0.12-21.el6op
Red Hat:openshift:1::el6ruby193-rubygem-activerecordbefore 1:3.2.8-2.el61:3.2.8-2.el6
Red Hat:openshift:1::el6ruby193-rubygem-activerecord-docbefore 1:3.2.8-2.el61:3.2.8-2.el6
Red Hat:openshift:1::el6ruby193-rubygem-passengerbefore 0:3.0.12-21.el6op0:3.0.12-21.el6op
Red Hat:openshift:1::el6ruby193-rubygem-passenger-debuginfobefore 0:3.0.12-21.el6op0:3.0.12-21.el6op
Red Hat:openshift:1::el6ruby193-rubygem-passenger-develbefore 0:3.0.12-21.el6op0:3.0.12-21.el6op

+16

Other highest-scoring records for the same primary product.

  • CVE-2019-5418There is a File Content Disclosure vulnerability in Action View <5.2.2.1, <5.1.6.2, <5.0.7.2, <4.2.11.1 and v3 where specially crafted accepKEV
    90Now
  • CVE-2016-0752Directory traversal vulnerability in Action View in Ruby on Rails before 3.2.22.1, 4.0.x and 4.1.x before 4.1.14.1, 4.2.x before 4.2.5.1, anKEV
    89Now
  • CVE-2019-5420A remote code execution vulnerability in development mode Rails <5.2.2.1, <6.0.0.beta3 can allow an attacker to guess the automatically gene
    66This week
  • CVE-2020-8163The is a code injection vulnerability in versions of Rails prior to 5.0.1 that wouldallow an attacker who controlled the `locals` argument o
    60This week
  • CVE-2013-0156active_support/core_ext/hash/conversions.rb in Ruby on Rails before 2.3.15, 3.0.x before 3.0.19, 3.1.x before 3.1.10, and 3.2.x before 3.2.1
    60This week
  • CVE-2013-0333lib/active_support/json/backends/yaml.rb in Ruby on Rails 2.3.x before 2.3.16 and 3.0.x before 3.0.20 does not properly convert JSON data to
    59Plan

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
debian:rails2.3.14.1 · Debian:12Package registry (OSV)
red hat:libmongodb0:2.0.2-6.el6op · Red Hat:openshift:1::el6Package registry (OSV)
red hat:mongodb0:2.0.2-6.el6op · Red Hat:openshift:1::el6Package registry (OSV)
red hat:mongodb-debuginfo0:2.0.2-6.el6op · Red Hat:openshift:1::el6Package registry (OSV)
red hat:mongodb-devel0:2.0.2-6.el6op · Red Hat:openshift:1::el6Package registry (OSV)
red hat:mongodb-server0:2.0.2-6.el6op · Red Hat:openshift:1::el6Package registry (OSV)
red hat:openshift-console0:0.0.13-2.el6op · Red Hat:openshift:1::el6Package registry (OSV)
red hat:openshift-origin-broker0:1.0.10-1.el6op · Red Hat:openshift:1::el6Package registry (OSV)
red hat:openshift-origin-broker-util0:1.0.14-1.el6op · Red Hat:openshift:1::el6Package registry (OSV)
red hat:rhc0:1.3.2-1.3.el6op · Red Hat:openshift:1::el6Package registry (OSV)
red hat:ruby193-mod_passenger0:3.0.12-21.el6op · Red Hat:openshift:1::el6Package registry (OSV)
red hat:ruby193-rubygem-activerecord1:3.2.8-2.el6 · Red Hat:openshift:1::el6Package registry (OSV)
red hat:ruby193-rubygem-activerecord-doc1:3.2.8-2.el6 · Red Hat:openshift:1::el6Package registry (OSV)
RubyGems:activerecord2.3.15Package registry (OSV)
RubyGems:activerecord3.0.18Package registry (OSV)
RubyGems:activerecord3.1.9Package registry (OSV)
RubyGems:activerecord3.2.10Package registry (OSV)

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

EPSS, last 120 days

FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).

Patch and commit links

Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.

No commit or PR link among the references.

Finders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.

No credits in the CNA record.

Variant candidates

Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.

No nightly-computed relations.

Chain candidates

An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.

—

Bug bounty scope

The product’s vendor appears in a public program. Matched by name; verify the scope text in the program.

Technical details

Attack conditions

  • No special conditions are required; it is repeatable.

If successful

Confidentiality
P · data can be read
Integrity
P · data or configuration can be modified
Availability
P · the service can be disrupted
Attack complexity
Low
Confidentiality impact
P
Integrity impact
P
Availability impact
P

CVSS vector

AV:N/AC:L/Au:N/C:P/I:P/A:P

nvd-primary

Root cause

The query text is built by concatenating user input. The database cannot tell where the data ends and the command begins.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

ts
const owner = req.query.owner;const rows = await db.query(  "SELECT * FROM files WHERE owner = '" + owner + "'");

Fixed

ts
const owner = req.query.owner;const rows = await db.query(  "SELECT * FROM files WHERE owner = $1",  [owner]);

Noroxi analysis

No Noroxi analysis for this record yet

We don't hand-write analysis for all 385,000+ vulnerabilities; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.

We use this product, ask for help

Change log

  1. Fix✗ → ✓

For records you follow, these changes also arrive as notifications. →

References

All records