CVE-2016-6317: Activerecord ActiveRecord Vulnerability

HIGH
Advisory Identifier: GHSA-pr3r-4wrp-r2pv
CVSS 7.5
CWE-284 CWE-476
Published
Advisory Summary

CVE-2016-6317 is a HIGH (CVSS 7.5) activerecord vulnerability (CWE-284: Improper Access Control) affecting Activerecord libraries in the RubyGems ecosystem. The issue involves activerecord in ruby on rails allows database-query bypass. Remediation is available by upgrading affected packages to version 4.2.7.1.

CVE-2016-6317 at a Glance

CVE Identifier CVE-2016-6317
GHSA Identifier GHSA-pr3r-4wrp-r2pv
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-284: Improper Access Control
Affected Product Activerecord
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2016-6317

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.2.7.1
Upgrade activerecord to 4.2.7.1
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-2016-6317, 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.2.7.1), 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. 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

Active Record in Ruby on Rails 4.2.x before 4.2.7.1 does not properly consider differences in parameter handling between the Active Record component and the JSON implementation, which allows remote attackers to bypass intended database-query restrictions and perform NULL checks or trigger missing WHERE clauses via a crafted request, as demonstrated by certain "[nil]" values, a related issue to CVE-2012-2660, CVE-2012-2694, and CVE-2013-0155.

CVE-2016-6317 Affected Activerecord Versions

1 component(s)
Fixed Versions:
4.2.7.1
Product / Package Ecosystem Affected Versions Fixed Version
activerecord
RubyGems
≥ 4.2.0
< 4.2.7.1
4.2.7.1

References

Frequently Asked Questions

What is CVE-2016-6317?
CVE-2016-6317 is a security vulnerability in Activerecord involving ActiveRecord in Ruby on Rails allows database-query bypass under CWE-284: Improper Access Control.
Which Activerecord versions are affected?
Affected versions include releases prior to 4.2.7.1 across affected packages: activerecord.
What version fixes CVE-2016-6317?
Upgrading to 4.2.7.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is activerecord affected?
Yes, activerecord is affected in releases prior to 4.2.7.1. Upgrade your dependency to 4.2.7.1 or later.
What is the CVSS score of CVE-2016-6317?
CVE-2016-6317 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2016-6317?
CVE-2016-6317 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check RubyGems dependencies for CVE-2016-6317?
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-pr3r-4wrp-r2pv",
  "modified" : "2023-07-04T00:01:26Z",
  "published" : "2017-10-24T18:33:35Z",
  "aliases" : [ "CVE-2016-6317" ],
  "summary" : "ActiveRecord in Ruby on Rails allows database-query bypass",
  "details" : "Active Record in Ruby on Rails 4.2.x before 4.2.7.1 does not properly consider differences in parameter handling between the Active Record component and the JSON implementation, which allows remote attackers to bypass intended database-query restrictions and perform NULL checks or trigger missing WHERE clauses via a crafted request, as demonstrated by certain \"[nil]\" values, a related issue to CVE-2012-2660, CVE-2012-2694, and CVE-2013-0155.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activerecord"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.2.0"
      }, {
        "fixed" : "4.2.7.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.2.7.0"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-6317"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2016-6317.yml"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!topic/ruby-security-ann/WccgKSKiPZA"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!topic/rubyonrails-security/rgO20zYW33s"
  }, {
    "type" : "WEB",
    "url" : "http://rhn.redhat.com/errata/RHSA-2016-1855.html"
  }, {
    "type" : "WEB",
    "url" : "http://weblog.rubyonrails.org/2016/8/11/Rails-5-0-0-1-4-2-7-2-and-3-2-22-3-have-been-released"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2016/08/11/4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284", "CWE-476" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:49:56Z",
    "nvd_published_at" : null
  }
}