CVE-2012-2661: Active Record vulnerable to SQL Injection via nested query parameters
N/A
CVSS Score
Basic Information
CVE ID
GHSA ID
EPSS Score
0.8472%
CWE
Published
10/24/2017
Updated
11/6/2023
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
-
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
activerecord | rubygems | >= 3.0.0, < 3.0.13 | 3.0.13 |
activerecord | rubygems | >= 3.1.0, < 3.1.5 | 3.1.5 |
activerecord | rubygems | >= 3.2.0, < 3.2.4 | 3.2.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from how ActiveRecord's where method handled nested parameters. The security patch modifies ActiveRecord::Relation#where in query_methods.rb to add parameter validation (checking for Hash type) and sanitization using create_binds. This indicates the original implementation lacked proper safeguards for nested query parameters, making it vulnerable to SQL injection through crafted nested hashes. The function appears in stack traces when processing user-supplied parameters for database queries.