CVE-2011-2930: Activerecord SQL Injection Vulnerability

HIGH
Advisory Identifier: GHSA-h6w6-xmqv-7q78
CWE-89
Published
Advisory Summary

CVE-2011-2930 is a HIGH sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Activerecord libraries in the RubyGems ecosystem. The issue involves activerecord vulnerable to sql injection. Remediation is available by upgrading affected packages to version 2.3.13, 3.0.10, 3.1.0.rc5.

CVE-2011-2930 at a Glance

CVE Identifier CVE-2011-2930
GHSA Identifier GHSA-h6w6-xmqv-7q78
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Activerecord
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2011-2930

To remediate this vulnerability, upgrade all affected Activerecord dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

activerecord fixed: 2.3.13
Upgrade activerecord to 2.3.13
activerecord fixed: 3.0.10
Upgrade activerecord to 3.0.10
activerecord fixed: 3.1.0.rc5
Upgrade activerecord to 3.1.0.rc5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for activerecord

How to Check if You Are Affected

To determine whether your application is affected by CVE-2011-2930, inspect your project dependencies for Activerecord:

inspect dependencies for activerecord

Analyze the terminal output to locate any version of Activerecord in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.13), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Activerecord, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Multiple SQL injection vulnerabilities in the `quote_table_name` method in the ActiveRecord adapters in `activerecord/lib/active_record/connection_adapters/` in Ruby on Rails before 2.3.13, 3.0.x before 3.0.10, and 3.1.x before 3.1.0.rc5 allow remote attackers to execute arbitrary SQL commands via a crafted column name.

CVE-2011-2930 Affected Activerecord Versions

3 component(s)
Fixed Versions:
2.3.133.0.103.1.0.rc5
Product / Package Ecosystem Affected Versions Fixed Version
activerecord
RubyGems
≥ 2.0.0
< 2.3.13
2.3.13
activerecord
RubyGems
≥ 3.0.0.beta
< 3.0.10
3.0.10
activerecord
RubyGems
≥ 3.1.0.beta1
< 3.1.0.rc5
3.1.0.rc5

References

NVD — CVE-2011-2930 NVD
https://nvd.nist.gov/vuln/detail/CVE-2011-2930
Security Fix Commit FIX COMMIT
https://github.com/rails/rails/commit/8a39f411dc3c806422785b1f4d5c7c9d58e4bf85
bugzilla.redhat.com/show_bug.cgi WEB
https://bugzilla.redhat.com/show_bug.cgi?id=731438
Activerecord Source Repository REPOSITORY
https://github.com/rails/rails
Activerecord Source Repository REPOSITORY
https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2011-2930.yml
Activerecord Security Information SECURITY
http://groups.google.com/group/rubyonrails-security/msg/b1a85d36b0f9dd30?dmode=source&output=gplain
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2011-September/065212.html
weblog.rubyonrails.org/2011/8/16/ann-rails... WEB
http://weblog.rubyonrails.org/2011/8/16/ann-rails-3-1-0-rc6
Activerecord Security Information SECURITY
http://www.debian.org/security/2011/dsa-2301
Activerecord Security Information SECURITY
http://www.openwall.com/lists/oss-security/2011/08/17/1
Activerecord Security Information SECURITY
http://www.openwall.com/lists/oss-security/2011/08/19/11
Activerecord Security Information SECURITY
http://www.openwall.com/lists/oss-security/2011/08/20/1
Activerecord Security Information SECURITY
http://www.openwall.com/lists/oss-security/2011/08/22/13
Activerecord Security Information SECURITY
http://www.openwall.com/lists/oss-security/2011/08/22/14
Activerecord Security Information SECURITY
http://www.openwall.com/lists/oss-security/2011/08/22/5

Frequently Asked Questions

What is CVE-2011-2930?
CVE-2011-2930 is a security vulnerability in Activerecord involving activerecord vulnerable to SQL Injection under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Activerecord versions are affected?
Affected versions include releases prior to 2.3.13, 3.0.10, 3.1.0.rc5 across affected packages: activerecord.
What version fixes CVE-2011-2930?
Upgrading to 2.3.13, 3.0.10, 3.1.0.rc5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is activerecord affected?
Yes, activerecord is affected in releases prior to 2.3.13, 3.0.10, 3.1.0.rc5. Upgrade your dependency to 2.3.13, 3.0.10, 3.1.0.rc5 or later.
What CWE is associated with CVE-2011-2930?
CVE-2011-2930 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check RubyGems dependencies for CVE-2011-2930?
Run the dependency tree command: 'inspect dependencies for activerecord'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h6w6-xmqv-7q78",
  "modified" : "2025-11-03T13:56:05Z",
  "published" : "2017-10-24T18:33:38Z",
  "aliases" : [ "CVE-2011-2930" ],
  "summary" : "activerecord vulnerable to SQL Injection",
  "details" : "Multiple SQL injection vulnerabilities in the `quote_table_name` method in the ActiveRecord adapters in `activerecord/lib/active_record/connection_adapters/` in Ruby on Rails before 2.3.13, 3.0.x before 3.0.10, and 3.1.x before 3.1.0.rc5 allow remote attackers to execute arbitrary SQL commands via a crafted column name.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activerecord"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.3.13"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activerecord"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0.beta"
      }, {
        "fixed" : "3.0.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activerecord"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.1.0.beta1"
      }, {
        "fixed" : "3.1.0.rc5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2011-2930"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/8a39f411dc3c806422785b1f4d5c7c9d58e4bf85"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=731438"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/rails"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2011-2930.yml"
  }, {
    "type" : "WEB",
    "url" : "http://groups.google.com/group/rubyonrails-security/msg/b1a85d36b0f9dd30?dmode=source&output=gplain"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2011-September/065212.html"
  }, {
    "type" : "WEB",
    "url" : "http://weblog.rubyonrails.org/2011/8/16/ann-rails-3-1-0-rc6"
  }, {
    "type" : "WEB",
    "url" : "http://www.debian.org/security/2011/dsa-2301"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2011/08/17/1"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2011/08/19/11"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2011/08/20/1"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2011/08/22/13"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2011/08/22/14"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2011/08/22/5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:39:17Z",
    "nvd_published_at" : "2011-08-29T18:55:01Z"
  }
}