CVE-2019-3881: Bundler Insecure Path Handling Vulnerability
HIGHCVE-2019-3881 is a HIGH (CVSS 7.0) insecure path handling vulnerability (CWE-552: Files or Directories Accessible to External Parties) affecting Bundler libraries in the RubyGems ecosystem. The issue involves insecure path handling in bundler. Remediation is available by upgrading affected packages to version 2.1.0.
CVE-2019-3881 at a Glance
Security Impact
CVSS: 7.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2019-3881
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.1.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-2019-3881, 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.1.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-552: Files or Directories Accessible to External Parties, where the product makes files or directories accessible to unauthorized actors, even though they should not be. 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-2019-3881 Affected Bundler Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
bundler
|
RubyGems |
≥ 1.14.0
< 2.1.0
|
2.1.0
|
References
Frequently Asked Questions
What is CVE-2019-3881?
Which Bundler versions are affected?
What version fixes CVE-2019-3881?
Is bundler affected?
What is the CVSS score of CVE-2019-3881?
What CWE is associated with CVE-2019-3881?
How can I check RubyGems dependencies for CVE-2019-3881?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-g98m-96g9-wfjq",
"modified" : "2023-07-05T20:18:22Z",
"published" : "2021-05-10T14:53:59Z",
"aliases" : [ "CVE-2019-3881" ],
"summary" : "Insecure path handling in Bundler",
"details" : "Bundler prior to 2.1.0 uses a predictable path in `/tmp/`, created with insecure permissions as a storage location for gems, if locations under the user's home directory are not available. If Bundler is used in a scenario where the user does not have a writable home directory, an attacker could place malicious code in this directory that would be later loaded and executed.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "bundler"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.14.0"
}, {
"fixed" : "2.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-3881"
}, {
"type" : "WEB",
"url" : "https://github.com/rubygems/bundler/issues/6501"
}, {
"type" : "WEB",
"url" : "https://github.com/rubygems/bundler/pull/7416/commits/65cfebb041c454c246aaf32a177b0243915a9998"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1651826"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-g98m-96g9-wfjq"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/rubygems/bundler"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/bundler/CVE-2019-3881.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-427", "CWE-552" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-04T22:52:44Z",
"nvd_published_at" : "2020-09-04T12:15:00Z"
}
}