CVE-2016-6317 — ActiveRecord in activerecord — CVE Details
ActiveRecord in Ruby on Rails allows database-query bypass
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (3.90%). Schedule for your next planned update.
Does your project use an affected activerecord version?
Paste your Gemfile.lock to check it for CVE-2016-6317 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.
Advisory Timeline
- First published October 24, 2017 (3321 days ago).
- Last revised February 20, 2024 — 2309 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install activerecord -v 4.2.7.1
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| activerecord RubyGems · Affected: 4.2.0, 4.2.1, 4.2.1.rc1, 4.2.1.rc2 (+16 more) | 4.2.7.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-284
- CWE-476NULL Pointer DereferenceMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
References
- https://nvd.nist.gov/vuln/detail/CVE-2016-6317ADVISORY
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2016-6317.ymlWEB
- https://groups.google.com/forum/#!topic/ruby-security-ann/WccgKSKiPZAWEB
- https://groups.google.com/forum/#!topic/rubyonrails-security/rgO20zYW33sWEB
- https://rhn.redhat.com/errata/RHSA-2016-1855.htmlWEB
- https://weblog.rubyonrails.org/2016/8/11/Rails-5-0-0-1-4-2-7-2-and-3-2-22-3-have-been-releasedWEB
- https://www.openwall.com/lists/oss-security/2016/08/11/4WEB
Frequently Asked Questions
- What is CVE-2016-6317?
- ActiveRecord in Ruby on Rails allows database-query bypass. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2016-6317?
- CVE-2016-6317 affects activerecord. It has a 3.9% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2016-6317 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This places it in the top 10% of EPSS-scored vulnerabilities — 91% of tracked vulnerabilities score at or below it, so it is substantially more likely to be exploited than most tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2022-32224CRITICAL
Active Record RCE bug with Serialized Columns
- CVE-2013-3221CRITICAL
Active Record component in Ruby on Rails has a data-type injection vulnerability
- CVE-2022-44566HIGH
Denial of Service Vulnerability in ActiveRecord's PostgreSQL adapter
- CVE-2026-126366HIGH
msgpack-ruby JRuby decoder makes uncapped header-count allocations; a 5-byte message forces multi-GiB OOM
- CVE-2021-22880HIGH
Active Record subject to Regular Expression Denial-of-Service (ReDoS)
- CVE-2023-22794HIGH
SQL Injection Vulnerability via ActiveRecord comments
- CVE-2026-126081HIGH
Action Pack: Possible Strong Parameters Bypass in Parameters#each_key
- CVE-2025-55193MEDIUM
Active Record logging vulnerable to ANSI escape injection