LiveActive security incident?Get immediate response
CVE Record

CVE-2021-43809: Local Code Execution through Argument Injection via dash leading git url parameter in Gemfile

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

MediumCVSS 6.7Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

CVE-2021-43809 affects Bundler before 2.2.33. A malicious project can make Bundler pass attacker-controlled Gemfile data to Git as an option, potentially causing local code execution when a user runs Bundler against that project. This is serious for developer workstations and CI, but requires user interaction and a vulnerable Bundler version.

Executive priority

Prioritize remediation on developer and CI environments that process outside code. The business risk is supply-chain execution during dependency setup, not direct internet compromise. Patch during normal security maintenance, faster for systems handling untrusted pull requests or customer-supplied projects.

Technical view

The issue is CWE-88 argument injection in Bundler Git dependency handling. Bundler avoided shell command injection but did not protect positional Git arguments from leading-dash values, allowing user-controlled Gemfile Git URLs to be interpreted as options. Bundler 2.2.33 fixed affected Git command invocations by inserting an option terminator before positional arguments.

Likely exposure

Exposure is mainly developer machines, build servers, and CI jobs that evaluate untrusted or newly cloned Ruby projects using Bundler before 2.2.33. This is not described as a remotely reachable service vulnerability.

Exploitation context

Sources describe high interaction requirements: an attacker must provide a crafted project or Gemfile, and the victim must run a Bundler command that reads it. The bundle says KEV is false, and no cited source here establishes active exploitation.

Researcher notes

The core distinction is argument injection, not shell injection. The advisory notes Bundler already used argument arrays, but Git still parsed leading-dash user input as options. Public sources identify Bundler 2.2.33 as the fix. Evidence provided does not support claiming broad exploitation.

Mitigation direction

  • Upgrade Bundler to version 2.2.33 or later.
  • Check operating-system package advisories for patched bundled RubyGems or Bundler packages.
  • Treat Gemfiles from untrusted projects as executable-risk content.
  • Avoid running Bundler commands automatically on unreviewed third-party repositories.
  • Review CI jobs that run Bundler on external pull requests or supplied source trees.

Validation and detection

  • Inventory Bundler versions on developer endpoints and CI images.
  • Confirm Bundler is 2.2.33 or later where Git dependencies are processed.
  • Search project Gemfiles for Git dependency URLs beginning with a dash.
  • Review CI workflows that run Bundler before repository trust checks.
  • Verify vendor or distribution packages include the documented Bundler fix.
Prepared
Confidence
high
Sources
8

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-88: Command execution behavior lookup

Command injection weaknesses can lead defenders to review execution techniques and command interpreter telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-43809 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Medium
CVSS
6.7 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
7Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
6.7CVSS 3.1MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H0.85.9Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

6.7Medium
CVSS 3.1 vector shape for CVE-2021-43809Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
rubygemsrubygems< 2.2.33Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-88 · source CWE mapping

Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.