# CVE-2012-2661: Active Record vulnerable to SQL Injection via nested query parameters

Source: https://junglewise.ai/threats/cve-2012-2661-active-record-vulnerable-to-sql-injection-via-nested-query  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2017-10-24  
License: CC BY 4.0 with a link back

CVE-2012-2661 · Severity: info · Published 2017-10-24

Active Record vulnerable to SQL Injection via nested query parameters

Technologies: [activerecord (RubyGems)](https://junglewise.ai/threats/technologies/rubygems-activerecord). Vendors: [RubyGems](https://junglewise.ai/threats/vendors/rubygems).

## Quick answers

**Is CVE-2012-2661 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2012-2661 being exploited in the wild.

**How severe is CVE-2012-2661?** Informational severity, published 24 October 2017.

**Which products and versions are affected?** activerecord (RubyGems) ECOSYSTEM:introduced=3.0.0,fixed=3.0.13.

**Is there a fix for CVE-2012-2661?** Yes. activerecord (RubyGems): upgrade to 3.0.13 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2012-2661?** Check whether you run activerecord (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- activerecord (RubyGems): upgrade to 3.0.13 or later

  ```sh
  bundle update activerecord
  ```


## Affected products

- activerecord (RubyGems) ECOSYSTEM:introduced=3.0.0,fixed=3.0.13

## Identifiers

- CVE-2012-2661
- GHSA-fh39-v733-mxfr

## Related threats

- [Active Record logging vulnerable to ANSI escape injection](https://junglewise.ai/threats/cve-2025-55193-active-record-logging-vulnerable-to-ansi-escape-injection)
- [Denial of Service Vulnerability in ActiveRecord's PostgreSQL adapter](https://junglewise.ai/threats/cve-2022-44566-denial-of-service-vulnerability-in-activerecord-s-postgresql)
- [SQL Injection Vulnerability via ActiveRecord comments](https://junglewise.ai/threats/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comments)
- [Ruby on Rails Active Record RCE via YAML Deserialization in Serialized Columns](https://junglewise.ai/threats/cve-2022-32224-ruby-on-rails-active-record-rce-via-yaml-deserialization-in)
- [Active Record component in Ruby on Rails has a data-type injection vulnerability](https://junglewise.ai/threats/cve-2013-3221-active-record-component-in-ruby-on-rails-has-a-data-type-injection)
