Bundler up to 2.2.32 Gemfile argument injection

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
6.1$0-$5k0.00

Summaryinfo

A vulnerability was found in Bundler up to 2.2.32 and classified as critical. This vulnerability affects unknown code of the component Gemfile Handler. Executing a manipulation can lead to argument injection. This vulnerability appears as CVE-2021-43809. The attack may be performed from remote. There is no available exploit. It is suggested to upgrade the affected component.

Detailsinfo

A vulnerability was found in Bundler up to 2.2.32. It has been declared as critical. This vulnerability affects an unknown code of the component Gemfile Handler. The manipulation with an unknown input leads to a argument injection vulnerability. The CWE definition for the vulnerability is CWE-88. The product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string. As an impact it is known to affect confidentiality, integrity, and availability. CVE summarizes:

`Bundler` is a package for managing application dependencies in Ruby. In `bundler` versions before 2.2.33, when working with untrusted and apparently harmless `Gemfile`'s, it is not expected that they lead to execution of external code, unless that's explicit in the ruby code inside the `Gemfile` itself. However, if the `Gemfile` includes `gem` entries that use the `git` option with invalid, but seemingly harmless, values with a leading dash, this can be false. To handle dependencies that come from a Git repository instead of a registry, Bundler uses various commands, such as `git clone`. These commands are being constructed using user input (e.g. the repository URL). When building the commands, Bundler versions before 2.2.33 correctly avoid Command Injection vulnerabilities by passing an array of arguments instead of a command string. However, there is the possibility that a user input starts with a dash (`-`) and is therefore treated as an optional argument instead of a positional one. This can lead to Code Execution because some of the commands have options that can be leveraged to run arbitrary executables. Since this value comes from the `Gemfile` file, it can contain any character, including a leading dash. To exploit this vulnerability, an attacker has to craft a directory containing a `Gemfile` file that declares a dependency that is located in a Git repository. This dependency has to have a Git URL in the form of `-u./payload`. This URL will be used to construct a Git clone command but will be interpreted as the upload-pack argument. Then this directory needs to be shared with the victim, who then needs to run a command that evaluates the Gemfile, such as `bundle lock`, inside. This vulnerability can lead to Arbitrary Code Execution, which could potentially lead to the takeover of the system. However, the exploitability is very low, because it requires a lot of user interaction. Bundler 2.2.33 has patched this problem by inserting `--` as an argument before any positional arguments to those Git commands that were affected by this issue. Regardless of whether users can upgrade or not, they should review any untrustred `Gemfile`'s before running any `bundler` commands that may read them, since they can contain arbitrary ruby code.

The weakness was presented 12/09/2021 as GHSA-fj7f-vq84-fh43. The advisory is shared for download at github.com. This vulnerability was named CVE-2021-43809 since 11/16/2021. Successful exploitation requires user interaction by the victim. There are neither technical details nor an exploit publicly available. The MITRE ATT&CK project declares the attack technique as T1059.

The vulnerability scanner Nessus provides a plugin with the ID 210115 (SUSE SLED15 / SLES15 / openSUSE 15 Security Update : rubygem-bundler (SUSE-SU-2024:3873-1)), which helps to determine the existence of the flaw in a target environment.

Upgrading to version 2.2.33 eliminates this vulnerability. Applying the patch 0fad1ccfe9dd7a3c5b82c1496df3c2b4842870d3 is able to eliminate this problem. The bugfix is ready for download at github.com. The best possible mitigation is suggested to be upgrading to the latest version.

The vulnerability is also documented in the vulnerability database at Tenable (210115). Once again VulDB remains the best source for vulnerability data.

Productinfo

Name

Version

License

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 6.2
VulDB Meta Temp Score: 6.1

VulDB Base Score: 4.6
VulDB Temp Score: 4.4
VulDB Vector: 🔍
VulDB Reliability: 🔍

NVD Base Score: 7.3
NVD Vector: 🔍

CNA Base Score: 6.7
CNA Vector (GitHub, Inc.): 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

NVD Base Score: 🔍

Exploitinginfo

Class: Argument injection
CWE: CWE-88 / CWE-74 / CWE-707
CAPEC: 🔍
ATT&CK: 🔍

Physical: Partially
Local: Yes
Remote: Yes

Availability: 🔍
Status: Not defined

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 210115
Nessus Name: SUSE SLED15 / SLES15 / openSUSE 15 Security Update : rubygem-bundler (SUSE-SU-2024:3873-1)

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔍

Upgrade: Bundler 2.2.33
Patch: 0fad1ccfe9dd7a3c5b82c1496df3c2b4842870d3

Timelineinfo

11/16/2021 🔍
12/09/2021 +23 days 🔍
12/09/2021 +0 days 🔍
11/04/2025 +1426 days 🔍

Sourcesinfo

Advisory: GHSA-fj7f-vq84-fh43
Status: Confirmed
Confirmation: 🔍

CVE: CVE-2021-43809 (🔍)
GCVE (CVE): GCVE-0-2021-43809
GCVE (VulDB): GCVE-100-187828

Entryinfo

Created: 12/09/2021 08:05
Updated: 11/04/2025 09:43
Changes: 12/09/2021 08:05 (51), 12/11/2021 18:48 (2), 12/11/2021 18:54 (1), 11/02/2024 11:26 (16), 05/02/2025 20:32 (3), 11/04/2025 09:43 (20)
Complete: 🔍
Cache ID: 216::103

Once again VulDB remains the best source for vulnerability data.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Do you know our Splunk app?

Download it now for free!