CVE-2016-7954: Bundler Remote Code Execution Vulnerability
CRITICALCVE-2016-7954 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Bundler libraries in the RubyGems ecosystem. The issue involves bundler allows attacker to inject arbitrary code via secondary gem source. Remediation is available by upgrading affected packages to version 2.0.0.
CVE-2016-7954 at a Glance
Security Impact
CVSS: 9.8
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:H/I:H/A:H).
How to Fix CVE-2016-7954
To remediate this vulnerability, upgrade all affected Bundler 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 bundler to 2.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for bundler
How to Check if You Are Affected
To determine whether your application is affected by CVE-2016-7954, inspect your project dependencies for Bundler:
inspect dependencies for bundler
Analyze the terminal output to locate any version of Bundler in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0), 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Bundler, 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-7954 Affected Bundler Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
bundler
|
RubyGems |
≥ 1.0.0
< 2.0.0
|
2.0.0
|
References
Frequently Asked Questions
What is CVE-2016-7954?
Which Bundler versions are affected?
What version fixes CVE-2016-7954?
Is bundler affected?
What is the CVSS score of CVE-2016-7954?
What CWE is associated with CVE-2016-7954?
How can I check RubyGems dependencies for CVE-2016-7954?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jvgm-pfqv-887x",
"modified" : "2025-04-14T22:05:18Z",
"published" : "2022-05-14T00:57:16Z",
"aliases" : [ "CVE-2016-7954" ],
"summary" : "Bundler allows attacker to inject arbitrary code via secondary Gem source",
"details" : "Bundler 1.x might allow remote attackers to inject arbitrary Ruby code into an application by leveraging a gem name collision on a secondary source. NOTE: this might overlap CVE-2013-0334.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "bundler"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "2.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-7954"
}, {
"type" : "WEB",
"url" : "https://github.com/bundler/bundler/issues/5051"
}, {
"type" : "WEB",
"url" : "https://github.com/bundler/bundler/issues/5062"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1381951"
}, {
"type" : "WEB",
"url" : "https://collectiveidea.com/blog/archives/2016/10/06/bundlers-multiple-source-security-vulnerability"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/rubygems/bundler"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/bundler/CVE-2016-7954.yml"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20170214030311/http://www.securityfocus.com/bid/93423"
}, {
"type" : "WEB",
"url" : "http://collectiveidea.com/blog/archives/2016/10/06/bundlers-multiple-source-security-vulnerability"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2016/10/04/5"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2016/10/04/7"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2016/10/05/3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2023-06-23T21:46:31Z",
"nvd_published_at" : "2016-12-22T22:59:00Z"
}
}