GSD-2016-6317
Vulnerability from gsd - Updated: 2016-08-11 00:00{
"GSD": {
"alias": "CVE-2016-6317",
"description": "Action 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.",
"id": "GSD-2016-6317",
"references": [
"https://www.suse.com/security/cve/CVE-2016-6317.html",
"https://access.redhat.com/errata/RHSA-2016:1855"
]
},
"gsd": {
"metadata": {
"exploitCode": "unknown",
"remediation": "unknown",
"reportConfidence": "confirmed",
"type": "vulnerability"
},
"osvSchema": {
"affected": [
{
"package": {
"ecosystem": "RubyGems",
"name": "activerecord",
"purl": "pkg:gem/activerecord"
}
}
],
"aliases": [
"CVE-2016-6317",
"GHSA-pr3r-4wrp-r2pv"
],
"details": "There is a vulnerability when Active Record is used in conjunction with JSON\nparameter parsing. This vulnerability is similar to CVE-2012-2660,\nCVE-2012-2694 and CVE-2013-0155.\n\nImpact\n------\n\nDue to the way Active Record interprets parameters in combination with the way\nthat JSON parameters are parsed, it is possible for an attacker to issue\nunexpected database queries with \"IS NULL\" or empty where clauses. This issue\ndoes *not* let an attacker insert arbitrary values into an SQL query, however\nthey can cause the query to check for NULL or eliminate a WHERE clause when\nmost users wouldn\u0027t expect it.\n\nFor example, a system has password reset with token functionality:\n\n```ruby\n unless params[:token].nil?\n user = User.find_by_token(params[:token])\n user.reset_password!\n end\n```\n\nAn attacker can craft a request such that `params[:token]` will return\n`[nil]`. The `[nil]` value will bypass the test for nil, but will still add\nan \"IN (\u0027xyz\u0027, NULL)\" clause to the SQL query.\n\nSimilarly, an attacker can craft a request such that `params[:token]` will\nreturn an empty hash. An empty hash will eliminate the WHERE clause of the\nquery, but can bypass the `nil?` check.\n\nNote that this impacts not only dynamic finders (`find_by_*`) but also\nrelations (`User.where(:name =\u003e params[:name])`).\n\nAll users running an affected release should either upgrade or use one of the\nwork arounds immediately. All users running an affected release should upgrade\nimmediately. Please note, this vulnerability is a variant of CVE-2012-2660,\nCVE-2012-2694, and CVE-2013-0155. Even if you upgraded to address those\nissues, you must take action again.\n\nIf this chance in behavior impacts your application, you can manually decode\nthe original values from the request like so:\n\n `ActiveSupport::JSON.decode(request.body)`\n\nWorkarounds\n-----------\nThis problem can be mitigated by casting the parameter to a string before\npassing it to Active Record. For example:\n\n ```ruby\n unless params[:token].nil? || params[:token].to_s.empty?\n user = User.find_by_token(params[:token].to_s)\n user.reset_password!\n end\n ```\n",
"id": "GSD-2016-6317",
"modified": "2016-08-11T00:00:00.000Z",
"published": "2016-08-11T00:00:00.000Z",
"references": [
{
"type": "WEB",
"url": "https://groups.google.com/forum/#!topic/rubyonrails-security/rgO20zYW33s"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": 7.5,
"type": "CVSS_V3"
}
],
"summary": "Unsafe Query Generation Risk in Active Record"
}
},
"namespaces": {
"cve.org": {
"CVE_data_meta": {
"ASSIGNER": "secalert@redhat.com",
"ID": "CVE-2016-6317",
"STATE": "PUBLIC"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "n/a",
"version": {
"version_data": [
{
"version_value": "n/a"
}
]
}
}
]
},
"vendor_name": "n/a"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "Action 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."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "n/a"
}
]
}
]
},
"references": {
"reference_data": [
{
"name": "92434",
"refsource": "BID",
"url": "http://www.securityfocus.com/bid/92434"
},
{
"name": "[oss-security] 20160811 [CVE-2016-6317] Unsafe Query Generation Risk in Active Record",
"refsource": "MLIST",
"url": "http://www.openwall.com/lists/oss-security/2016/08/11/4"
},
{
"name": "RHSA-2016:1855",
"refsource": "REDHAT",
"url": "http://rhn.redhat.com/errata/RHSA-2016-1855.html"
},
{
"name": "http://weblog.rubyonrails.org/2016/8/11/Rails-5-0-0-1-4-2-7-2-and-3-2-22-3-have-been-released/",
"refsource": "CONFIRM",
"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/"
},
{
"name": "[ruby-security-ann] 20160811 [CVE-2016-6317] Unsafe Query Generation Risk in Active Record",
"refsource": "MLIST",
"url": "https://groups.google.com/forum/#!topic/ruby-security-ann/WccgKSKiPZA"
}
]
}
},
"github.com/rubysec/ruby-advisory-db": {
"cve": "2016-6317",
"cvss_v3": 7.5,
"date": "2016-08-11",
"description": "There is a vulnerability when Active Record is used in conjunction with JSON\nparameter parsing. This vulnerability is similar to CVE-2012-2660,\nCVE-2012-2694 and CVE-2013-0155.\n\nImpact\n------\n\nDue to the way Active Record interprets parameters in combination with the way\nthat JSON parameters are parsed, it is possible for an attacker to issue\nunexpected database queries with \"IS NULL\" or empty where clauses. This issue\ndoes *not* let an attacker insert arbitrary values into an SQL query, however\nthey can cause the query to check for NULL or eliminate a WHERE clause when\nmost users wouldn\u0027t expect it.\n\nFor example, a system has password reset with token functionality:\n\n```ruby\n unless params[:token].nil?\n user = User.find_by_token(params[:token])\n user.reset_password!\n end\n```\n\nAn attacker can craft a request such that `params[:token]` will return\n`[nil]`. The `[nil]` value will bypass the test for nil, but will still add\nan \"IN (\u0027xyz\u0027, NULL)\" clause to the SQL query.\n\nSimilarly, an attacker can craft a request such that `params[:token]` will\nreturn an empty hash. An empty hash will eliminate the WHERE clause of the\nquery, but can bypass the `nil?` check.\n\nNote that this impacts not only dynamic finders (`find_by_*`) but also\nrelations (`User.where(:name =\u003e params[:name])`).\n\nAll users running an affected release should either upgrade or use one of the\nwork arounds immediately. All users running an affected release should upgrade\nimmediately. Please note, this vulnerability is a variant of CVE-2012-2660,\nCVE-2012-2694, and CVE-2013-0155. Even if you upgraded to address those\nissues, you must take action again.\n\nIf this chance in behavior impacts your application, you can manually decode\nthe original values from the request like so:\n\n `ActiveSupport::JSON.decode(request.body)`\n\nWorkarounds\n-----------\nThis problem can be mitigated by casting the parameter to a string before\npassing it to Active Record. For example:\n\n ```ruby\n unless params[:token].nil? || params[:token].to_s.empty?\n user = User.find_by_token(params[:token].to_s)\n user.reset_password!\n end\n ```\n",
"framework": "rails",
"gem": "activerecord",
"ghsa": "pr3r-4wrp-r2pv",
"patched_versions": [
"\u003e= 4.2.7.1"
],
"title": "Unsafe Query Generation Risk in Active Record",
"unaffected_versions": [
"\u003c 4.2.0",
"\u003e= 5.0.0"
],
"url": "https://groups.google.com/forum/#!topic/rubyonrails-security/rgO20zYW33s"
},
"gitlab.com": {
"advisories": [
{
"affected_range": "\u003e=4.0.0.alpha \u003c4.2.7.1",
"affected_versions": "All versions starting from 4.0.0.alpha before 4.2.7.1",
"credit": "joernchen of Phenoelit",
"cvss_v2": "AV:N/AC:L/Au:N/C:N/I:P/A:N",
"cvss_v3": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
"cwe_ids": [
"CWE-1035",
"CWE-284",
"CWE-476",
"CWE-937"
],
"date": "2019-08-08",
"description": "There is a vulnerability when Active Record is used in conjunction with JSON parameter parsing. This vulnerability is similar to CVE-2012-2660, CVE-2012-2694 and CVE-2013-0155.",
"fixed_versions": [
"4.2.7.1"
],
"identifier": "CVE-2016-6317",
"identifiers": [
"CVE-2016-6317"
],
"not_impacted": "5.x, 3.x and earlier",
"package_slug": "gem/activerecord",
"pubdate": "2016-09-07",
"solution": "Upgrade to latest or use workaround; see provided link.",
"title": "Unsafe Query Generation Risk",
"urls": [
"https://groups.google.com/forum/#!topic/rubyonrails-security/rgO20zYW33s"
],
"uuid": "51b1a6d4-3eb3-48d4-8d25-ae62c2dbb3d4"
},
{
"affected_range": "\u003e=4.2.0 \u003c=4.2.7",
"affected_versions": "All versions starting from 4.2.0 up to 4.2.7",
"cvss_v2": "AV:N/AC:L/Au:N/C:N/I:P/A:N",
"cvss_v3": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
"cwe_ids": [
"CWE-1035",
"CWE-284",
"CWE-476",
"CWE-937"
],
"date": "2019-08-08",
"description": "The Rails gem 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.",
"fixed_versions": [
"4.2.8"
],
"identifier": "CVE-2016-6317",
"identifiers": [
"CVE-2016-6317"
],
"not_impacted": "All versions before 4.2.0, all versions after 4.2.7",
"package_slug": "gem/rails",
"pubdate": "2016-09-07",
"solution": "Upgrade to versions 4.2.8 or above.",
"title": "Improper Access Control",
"urls": [
"https://nvd.nist.gov/vuln/detail/CVE-2016-6317"
],
"uuid": "6154067c-1e91-4fe3-857c-8542e872f7b2"
}
]
},
"nvd.nist.gov": {
"configurations": {
"CVE_data_version": "4.0",
"nodes": [
{
"children": [],
"cpe_match": [
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.4:rc1:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.6:rc1:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.5:*:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.5:rc1:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.1:rc1:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.1:rc2:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.5:rc2:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.0:beta4:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.5.2:*:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.6:*:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.4:*:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.1:rc3:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.1:rc4:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.0:beta3:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.0:beta2:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.7:rc1:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.7:*:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.0:rc2:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.0:rc3:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.5.1:*:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.3:*:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.3:rc1:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.1:*:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.2:*:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.0:rc1:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.0:beta1:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
},
{
"cpe23Uri": "cpe:2.3:a:rubyonrails:rails:4.2.0:*:*:*:*:*:*:*",
"cpe_name": [],
"vulnerable": true
}
],
"operator": "OR"
}
]
},
"cve": {
"CVE_data_meta": {
"ASSIGNER": "secalert@redhat.com",
"ID": "CVE-2016-6317"
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "en",
"value": "Action 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."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "en",
"value": "CWE-284"
},
{
"lang": "en",
"value": "CWE-476"
}
]
}
]
},
"references": {
"reference_data": [
{
"name": "[oss-security] 20160811 [CVE-2016-6317] Unsafe Query Generation Risk in Active Record",
"refsource": "MLIST",
"tags": [
"Mailing List",
"Third Party Advisory"
],
"url": "http://www.openwall.com/lists/oss-security/2016/08/11/4"
},
{
"name": "http://weblog.rubyonrails.org/2016/8/11/Rails-5-0-0-1-4-2-7-2-and-3-2-22-3-have-been-released/",
"refsource": "CONFIRM",
"tags": [
"Release Notes"
],
"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/"
},
{
"name": "92434",
"refsource": "BID",
"tags": [],
"url": "http://www.securityfocus.com/bid/92434"
},
{
"name": "RHSA-2016:1855",
"refsource": "REDHAT",
"tags": [],
"url": "http://rhn.redhat.com/errata/RHSA-2016-1855.html"
},
{
"name": "[ruby-security-ann] 20160811 [CVE-2016-6317] Unsafe Query Generation Risk in Active Record",
"refsource": "MLIST",
"tags": [],
"url": "https://groups.google.com/forum/#!topic/ruby-security-ann/WccgKSKiPZA"
}
]
}
},
"impact": {
"baseMetricV2": {
"cvssV2": {
"accessComplexity": "LOW",
"accessVector": "NETWORK",
"authentication": "NONE",
"availabilityImpact": "NONE",
"baseScore": 5.0,
"confidentialityImpact": "NONE",
"integrityImpact": "PARTIAL",
"vectorString": "AV:N/AC:L/Au:N/C:N/I:P/A:N",
"version": "2.0"
},
"exploitabilityScore": 10.0,
"impactScore": 2.9,
"obtainAllPrivilege": false,
"obtainOtherPrivilege": false,
"obtainUserPrivilege": false,
"severity": "MEDIUM",
"userInteractionRequired": false
},
"baseMetricV3": {
"cvssV3": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "NONE",
"baseScore": 7.5,
"baseSeverity": "HIGH",
"confidentialityImpact": "NONE",
"integrityImpact": "HIGH",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
"version": "3.0"
},
"exploitabilityScore": 3.9,
"impactScore": 3.6
}
},
"lastModifiedDate": "2019-08-08T15:16Z",
"publishedDate": "2016-09-07T19:28Z"
}
}
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.