Executive Summary

Informations
Name CVE-2021-43809 First vendor Publication 2021-12-08
Vendor Cve Last vendor Modification 2023-11-16

Security-Database Scoring CVSS v3

Cvss vector : CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Overall CVSS Score 7.3
Base Score 7.3 Environmental Score 7.3
impact SubScore 5.9 Temporal Score 7.3
Exploitabality Sub Score 1.3
 
Attack Vector Local Attack Complexity Low
Privileges Required Low User Interaction Required
Scope Unchanged Confidentiality Impact High
Integrity Impact High Availability Impact High
Calculate full CVSS 3.0 Vectors scores

Security-Database Scoring CVSS v2

Cvss vector : (AV:N/AC:M/Au:N/C:C/I:C/A:C)
Cvss Base Score 9.3 Attack Range Network
Cvss Impact Score 10 Attack Complexity Medium
Cvss Expoit Score 8.6 Authentication None Required
Calculate full CVSS 2.0 Vectors scores

Detail

`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.

Original Source

Url : http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-43809

CWE : Common Weakness Enumeration

% Id Name
100 % CWE-88 Argument Injection or Modification

CPE : Common Platform Enumeration

TypeDescriptionCount
Application 184

Sources (Detail)

Source Url
CONFIRM https://github.com/rubygems/rubygems/security/advisories/GHSA-fj7f-vq84-fh43
MISC https://github.com/rubygems/rubygems/commit/0fad1ccfe9dd7a3c5b82c1496df3c2b48...
https://github.com/rubygems/rubygems/commit/a4f2f8ac17e6ce81c689527a8b6f14381...
https://github.com/rubygems/rubygems/pull/5142
https://www.sonarsource.com/blog/securing-developer-tools-package-managers/

Alert History

If you want to see full details history, please login or register.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Date Informations
2024-02-02 02:29:38
  • Multiple Updates
2024-02-01 12:25:07
  • Multiple Updates
2023-11-16 09:28:05
  • Multiple Updates
2023-10-27 17:28:24
  • Multiple Updates
2023-10-26 00:28:31
  • Multiple Updates
2023-09-05 13:24:04
  • Multiple Updates
2023-09-05 01:24:36
  • Multiple Updates
2023-09-02 13:22:27
  • Multiple Updates
2023-09-02 01:24:59
  • Multiple Updates
2023-08-12 13:28:26
  • Multiple Updates
2023-08-12 01:24:12
  • Multiple Updates
2023-08-11 13:20:38
  • Multiple Updates
2023-08-11 01:25:00
  • Multiple Updates
2023-08-06 13:18:34
  • Multiple Updates
2023-08-06 01:23:56
  • Multiple Updates
2023-08-04 13:18:57
  • Multiple Updates
2023-08-04 01:24:17
  • Multiple Updates
2023-07-14 13:19:00
  • Multiple Updates
2023-07-14 01:24:04
  • Multiple Updates
2023-03-29 02:21:00
  • Multiple Updates
2023-03-28 12:24:16
  • Multiple Updates
2022-10-11 13:10:20
  • Multiple Updates
2022-10-11 01:23:40
  • Multiple Updates
2021-12-13 21:22:52
  • Multiple Updates
2021-12-09 00:22:54
  • First insertion