Skip to content
OpenAdvisories
Medium Public exploit CVE-2012-2661 EUVD-2017-0229GHSA-fh39-v733-mxfr

Active Record vulnerable to SQL Injection via nested query parameters

Published Jun 22, 2012 · Updated Aug 6, 2024 · Assigned by redhat

Description

The Active Record component in Ruby on Rails 3.0.x before 3.0.13, 3.1.x before 3.1.5, and 3.2.x before 3.2.4 does not properly implement the passing of request data to a where method in an ActiveRecord class, which allows remote attackers to conduct certain SQL injection attacks via nested query parameters that leverage unintended recursion, a related issue to CVE-2012-2695.

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Red Hat OpenShift 1 graphviz +4 2.26.0-10.el6 RHSA-2013:0582
Red Hat OpenShift 1 openshift-console 0.0.16-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 openshift-origin-broker +1 1.0.11-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 openshift-origin-broker-util 1.0.15-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 openshift-origin-cartridge-diy-0.1 +3 1.0.3-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 openshift-origin-cartridge-haproxy-1.4 +1 1.0.4-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 openshift-origin-cartridge-jbossews-1.0 1.0.13-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 openshift-origin-cartridge-jenkins-1.4 +1 1.0.2-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 openshift-origin-cartridge-php-5.3 +2 1.0.5-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 openshift-origin-cartridge-postgresql-8.4 1.0.3-2.el6op RHSA-2013:0582
Red Hat OpenShift 1 openshift-origin-cartridge-ruby-1.8 1.0.7-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 openshift-origin-cartridge-ruby-1.9-scl 1.0.8-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 php +5 5.3.3-22.el6 RHSA-2013:0582
Red Hat OpenShift 1 ruby193-ruby +5 1.9.3.327-25.el6 RHSA-2013:0582
Red Hat OpenShift 1 ruby193-rubygem-actionpack +3 1:3.2.8-3.el6 RHSA-2013:0582
Red Hat OpenShift 1 ruby193-rubygem-bigdecimal 1.1.0-25.el6 RHSA-2013:0582
Red Hat OpenShift 1 ruby193-rubygem-io-console 0.3-25.el6 RHSA-2013:0582
Red Hat OpenShift 1 ruby193-rubygem-json 1.5.4-25.el6 RHSA-2013:0582
Red Hat OpenShift 1 ruby193-rubygem-minitest 2.5.1-25.el6 RHSA-2013:0582
Red Hat OpenShift 1 ruby193-rubygem-railties +3 3.2.8-2.el6 RHSA-2013:0582
Red Hat OpenShift 1 ruby193-rubygem-rake 0.9.2.2-25.el6 RHSA-2013:0582
Red Hat OpenShift 1 ruby193-rubygem-rdoc 3.9.4-25.el6 RHSA-2013:0582
Red Hat OpenShift 1 ruby193-rubygem-ruby_parser +1 2.3.1-3.el6op RHSA-2013:0582
Red Hat OpenShift 1 ruby193-rubygems +1 1.8.23-25.el6 RHSA-2013:0582
Red Hat OpenShift 1 rubygem-actionpack 1:3.0.13-4.el6op RHSA-2013:0582
Red Hat OpenShift 1 rubygem-activemodel +1 3.0.13-3.el6op RHSA-2013:0582
Red Hat OpenShift 1 rubygem-activerecord 1:3.0.13-5.el6op RHSA-2013:0582
Red Hat OpenShift 1 rubygem-bson +2 1.8.1-2.el6op RHSA-2013:0582
Red Hat OpenShift 1 rubygem-openshift-origin-console +1 1.0.10-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 rubygem-openshift-origin-controller 1.0.12-1.el6op RHSA-2013:0582
Red Hat OpenShift 1 rubygem-ruby_parser +1 2.0.4-6.el6op RHSA-2013:0582

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
RubyGems activerecord >= 3.0.0, < 3.0.13 3.0.13 GHSA-fh39-v733-mxfr
RubyGems activerecord >= 3.1.0, < 3.1.5 3.1.5 GHSA-fh39-v733-mxfr
RubyGems activerecord >= 3.2.0, < 3.2.4 3.2.4 GHSA-fh39-v733-mxfr

Advisories 1

References