CVE-2014-0080: Activerecord Array Data Injection Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-hqf9-rc9j-5fmj
CWE-89
Published
Advisory Summary

CVE-2014-0080 is a MODERATE array data injection vulnerability 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 array data injection vulnerability in activerecord. Remediation is available by upgrading affected packages to version 4.0.3, 4.1.0.beta2.

CVE-2014-0080 at a Glance

CVE Identifier CVE-2014-0080
GHSA Identifier GHSA-hqf9-rc9j-5fmj
Severity MODERATE
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-2014-0080

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: 4.0.3
Upgrade activerecord to 4.0.3
activerecord fixed: 4.1.0.beta2
Upgrade activerecord to 4.1.0.beta2
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-2014-0080, 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 4.0.3), 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

SQL injection vulnerability in `activerecord/lib/active_record/connection_adapters/postgresql/cast.rb` in Active Record in Ruby on Rails 4.0.x before 4.0.3, and 4.1.0.beta1, when PostgreSQL is used, allows remote attackers to execute "add data" SQL commands via vectors involving `\` (backslash) characters that are not properly handled in operations on array columns.

CVE-2014-0080 Affected Activerecord Versions

2 component(s)
Fixed Versions:
4.0.34.1.0.beta2
Product / Package Ecosystem Affected Versions Fixed Version
activerecord
RubyGems
≥ 4.0.0
< 4.0.3
4.0.3
activerecord
RubyGems
≥ 4.1.0.beta1
< 4.1.0.beta2
All 1 versions
4.1.0.beta1
4.1.0.beta2

References

Frequently Asked Questions

What is CVE-2014-0080?
CVE-2014-0080 is a security vulnerability in Activerecord involving Array data injection vulnerability in activerecord 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 4.0.3, 4.1.0.beta2 across affected packages: activerecord.
What version fixes CVE-2014-0080?
Upgrading to 4.0.3, 4.1.0.beta2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is activerecord affected?
Yes, activerecord is affected in releases prior to 4.0.3, 4.1.0.beta2. Upgrade your dependency to 4.0.3, 4.1.0.beta2 or later.
What CWE is associated with CVE-2014-0080?
CVE-2014-0080 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-2014-0080?
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-hqf9-rc9j-5fmj",
  "modified" : "2023-07-05T17:50:02Z",
  "published" : "2017-10-24T18:33:36Z",
  "aliases" : [ "CVE-2014-0080" ],
  "summary" : "Array data injection vulnerability in activerecord",
  "details" : "SQL injection vulnerability in `activerecord/lib/active_record/connection_adapters/postgresql/cast.rb` in Active Record in Ruby on Rails 4.0.x before 4.0.3, and 4.1.0.beta1, when PostgreSQL is used, allows remote attackers to execute \"add data\" SQL commands via vectors involving `\\` (backslash) characters that are not properly handled in operations on array columns.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activerecord"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activerecord"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0.beta1"
      }, {
        "fixed" : "4.1.0.beta2"
      } ]
    } ],
    "versions" : [ "4.1.0.beta1" ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2014-0080"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-hqf9-rc9j-5fmj"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/rails/tree/main/activerecord"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2014-0080.yml"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20210301004521/https://groups.google.com/forum/message/raw?msg=rubyonrails-security/Wu96YkTUR6s/pPLBMZrlwvYJ"
  }, {
    "type" : "WEB",
    "url" : "http://openwall.com/lists/oss-security/2014/02/18/9"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:40:47Z",
    "nvd_published_at" : "2014-02-20T15:27:02Z"
  }
}