CVE-2012-2695:
activerecord vulnerable to SQL Injection
7.5
CVSS Score
Basic Information
CVE ID
GHSA ID
EPSS Score
0.69617%
CWE
Published
10/24/2017
Updated
1/21/2025
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
AV:N/AC:L/Au:N/C:P/I:P/A:P
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
activerecord | rubygems | >= 3.1.0, < 3.1.6 | 3.1.6 |
activerecord | rubygems | >= 3.2.0, < 3.2.6 | 3.2.6 |
activerecord | rubygems | >= 3.0.0.beta, < 3.0.14 | 3.0.14 |
activerecord | rubygems | < 2.3.15 | 2.3.15 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The GitHub commit shows critical modifications to sanitize_sql_hash_for_conditions where a 'top_level' parameter was added and nested hash processing was restricted. The original implementation allowed arbitrary nested hash processing (via recursive calls) which could be exploited to inject SQL fragments. The added 'raise ActiveRecord::StatementInvalid' in non-top-level nested cases and test cases validating this behavior confirm this was the attack vector. The CVE description explicitly references improper handling of nested hashes in ActiveRecord's where method implementation, which maps directly to this function's responsibility for processing query conditions.