CVE-2016-6317: Activerecord ActiveRecord Vulnerability
HIGHCVE-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
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).
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.
Upgrade activerecord to 4.2.7.1
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
CVE-2016-6317 Affected Activerecord Versions
1 component(s)| 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?
Which Activerecord versions are affected?
What version fixes CVE-2016-6317?
Is activerecord affected?
What is the CVSS score of CVE-2016-6317?
What CWE is associated with CVE-2016-6317?
How can I check RubyGems dependencies for CVE-2016-6317?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}