CVE-2019-3881: High severity Bundler Bundler Ruby vulnerability

Published May 23, 2018
·
Updated

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.

Other sources

Bundler through version 1.17.1 creates a directory with insecure permissions in /tmp/ that, in certain circumstances, is used by Bundler to load rubygems, allowing attackers to write malicious libraries to this location and be later executed.

Bundler contains some helper code which creates a temporary directory in case a user's home directory is not present or writeable, however it creates it via non-randomized path, /tmp/bundler/home/username. Permissions for this directory are 0777 which allows an attacker to create subdirectory with an arbitrary username. Bundler processes started under an effective user without a home directory will load rubygems from this attacker-writable location, allowing for code execution.

Red Hat

Affected Software

3 affected componentsFixes available
redhat/rh-ruby26-ruby<0:2.6.7-119.el7
0:2.6.7-119.el7
redhat/bundler<2.1.0
2.1.0
Bundler Bundler Ruby<2.1.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/rh-ruby26-ruby to a version that resolves this vulnerability.

    Fixed in 0:2.6.7-119.el7
  2. Upgrade

    Upgrade redhat/bundler to a version that resolves this vulnerability.

    Fixed in 2.1.0
  3. Upgrade

    Upgrade bundler to a version that resolves this vulnerability.

    Fixed in 2.1.0
  4. Upgrade

    Upgrade bundler to a version that resolves this vulnerability.

    Fixed in 1.17.1
  5. Compensating control

    If Bundler is used for an account without a writable home directory, prevent untrusted users/processes from writing to the attacker-writable temporary gem location under /tmp (e.g., ensure appropriate filesystem permissions/ownership or isolation so paths like /tmp/bundler/home/username are not writable by attackers).

Event History

May 23, 2018
CVE Published
12:00 AM
Nov 21, 2018
Data Sourced
via Red Hat·12:38 AM
DescriptionSeverityAffected Software
Sep 4, 2020
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionWeakness

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2019-3881?

CVE-2019-3881 has a medium severity due to the potential for unauthorized access to sensitive data.

2

How do I fix CVE-2019-3881?

To fix CVE-2019-3881, upgrade Bundler to version 2.1.0 or later.

3

What software is affected by CVE-2019-3881?

CVE-2019-3881 affects Bundler versions prior to 2.1.0 and certain versions of the rh-ruby26-ruby package.

4

How does CVE-2019-3881 impact security?

CVE-2019-3881 allows attackers to exploit predictable paths in insecure temporary storage locations, potentially compromising gem integrity.

5

Is CVE-2019-3881 a local or remote vulnerability?

CVE-2019-3881 is classified as a local vulnerability since it requires local access to the system to exploit.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203