cve.bz

CVE-2021-43809 bundler bundler: Argument Injection

7.3 highExploit referenceEPSS 2.9%Fix available

High (7.3) in bundler bundler. EPSS 2.9% estimated probability of exploitation activity in the next 30 days. Fixed in bundler 2.2.33.

On this page
`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.

Severity

CVSS 3.1

7.3 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
EPSS
2.9% (unchanged from 2.9% a week ago; 2.9% 30 days ago) estimated probability of exploitation activity in the next 30 days; 87th percentile. Scored 2026-11-24. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-88 Improper Neutralization of Argument Delimiters in a Command (Argument Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-43809 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-43809?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-43809?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-43809 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
bundler:bundlerbefore 2.2.33

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-fj7f-vq84-fh43RubyGemsbundler<2.2.332.2.33

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11rubygems3.2.5-2+deb11u1DLA-4163-1
Debian12, 13, 14rubygems3.3.5-1DEBIAN-CVE-2021-43809
Ubuntu16.04:LTS, 20.04:LTS, Pro:18.04:LTSbundlerno fix listedUBUNTU-CVE-2021-43809
Red Hatenterprise_linux:8::appstreamruby, ruby-doc, ruby-irb and 5 more0:2.5.9-114.module+el8.10.0+23088+750dc6caRHSA-2025:7539
Red Hatenterprise_linux:8::appstreamrubygem-abrt, rubygem-abrt-doc0:0.3.0-4.module+el8.10.0+22021+135c76a8RHSA-2025:7539
Red Hatenterprise_linux:8::appstreamrubygem-bigdecimal, rubygem-bigdecimal-debuginfo0:1.3.4-114.module+el8.10.0+23088+750dc6caRHSA-2025:7539
Red Hatenterprise_linux:8::appstreamrubygem-bson, rubygem-bson-doc, rubygem-bson-debuginfo and 1 more0:4.3.0-2.module+el8.9.0+19193+435404aeRHSA-2025:7539
Red Hatenterprise_linux:8::appstreamrubygem-bundler, rubygem-bundler-doc0:1.16.1-5.module+el8.10.0+23088+750dc6caRHSA-2025:7539
Red Hatenterprise_linux:8::appstreamrubygem-did_you_mean0:1.2.0-114.module+el8.10.0+23088+750dc6caRHSA-2025:7539
Red Hatenterprise_linux:8::appstreamrubygem-io-console, rubygem-io-console-debuginfo0:0.4.6-114.module+el8.10.0+23088+750dc6caRHSA-2025:7539
Red Hatenterprise_linux:8::appstreamrubygem-json, rubygem-json-debuginfo0:2.1.0-114.module+el8.10.0+23088+750dc6caRHSA-2025:7539
Red Hatenterprise_linux:8::appstreamrubygem-minitest0:5.10.3-114.module+el8.10.0+23088+750dc6caRHSA-2025:7539
Red Hatenterprise_linux:8::appstreamrubygem-mongo, rubygem-mongo-doc0:2.5.1-2.module+el8.9.0+19193+435404aeRHSA-2025:7539
Red Hatenterprise_linux:8::appstreamrubygem-mysql2, rubygem-mysql2-doc, rubygem-mysql2-debuginfo and 1 more0:0.4.10-4.module+el8.9.0+19193+435404aeRHSA-2025:7539
Red Hatenterprise_linux:8::appstreamrubygem-net-telnet0:0.1.1-114.module+el8.10.0+23088+750dc6caRHSA-2025:7539
9 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Module for Basesystem 15 SP5, Linux Enterprise Module for Basesystem 15 SP6, Linux Enterprise Server 15 SP2-LTSS and 5 morerubygem-bundler1.16.1-150000.3.6.1SUSE-SU-2024:3873-1
SUSELinux Enterprise Module for Basesystem 15 SP7rubygem-bundler2.2.34-150700.21.3.1SUSE-SU-2026:1355-1
openSUSELeap 15.5rubygem-bundler1.16.1-150000.3.6.1SUSE-SU-2024:3873-1
AlmaLinux8ruby, ruby-doc, ruby-irb and 2 more2.5.9-114.module_el8.10.0+3991+5e651d4eALSA-2025:7539
AlmaLinux8rubygem-abrt0.3.0-4.module_el8.5.0+2625+ec418553ALSA-2025:7539
AlmaLinux8rubygem-abrt-doc0.3.0-4.module_el8.10.0+3871+342e2c2fALSA-2025:7539
AlmaLinux8rubygem-bigdecimal1.3.4-114.module_el8.10.0+3991+5e651d4eALSA-2025:7539
AlmaLinux8rubygem-bson4.3.0-2.module_el8.5.0+259+8cec6917ALSA-2025:7539
AlmaLinux8rubygem-bson4.3.0-2.module_el8.6.0+3170+4b08f9d4ALSA-2025:7539
AlmaLinux8rubygem-bson, rubygem-bson-doc4.3.0-2.module_el8.5.0+2625+ec418553ALSA-2025:7539
AlmaLinux8rubygem-bundler, rubygem-bundler-doc1.16.1-5.module_el8.10.0+3991+5e651d4eALSA-2025:7539
AlmaLinux8rubygem-did_you_mean1.2.0-114.module_el8.10.0+3991+5e651d4eALSA-2025:7539
AlmaLinux8rubygem-io-console0.4.6-114.module_el8.10.0+3991+5e651d4eALSA-2025:7539
AlmaLinux8rubygem-json2.1.0-114.module_el8.10.0+3991+5e651d4eALSA-2025:7539
AlmaLinux8rubygem-minitest5.10.3-114.module_el8.10.0+3991+5e651d4eALSA-2025:7539
14 more for AlmaLinux in the JSON.
Rocky Linux8ruby0:2.5.9-114.module+el8.10.0+1979+815637dfRLSA-2025:7539
Rocky Linux8rubygem-abrt0:0.3.0-4.module+el8.5.0+738+032c9c02RLSA-2025:7539
Rocky Linux8rubygem-abrt0:0.3.0-4.module+el8.9.0+1536+5f79634eRLSA-2025:7539
Rocky Linux8rubygem-bson0:4.3.0-2.module+el8.9.0+1536+5f79634eRLSA-2025:7539
Rocky Linux8rubygem-bundler0:1.16.1-5.module+el8.10.0+1979+815637dfRLSA-2025:7539
Rocky Linux8rubygem-mongo0:2.5.1-2.module+el8.9.0+1536+5f79634eRLSA-2025:7539
Rocky Linux8rubygem-mysql20:0.4.10-4.module+el8.9.0+1536+5f79634eRLSA-2025:7539
Rocky Linux8rubygem-pg0:1.0.0-3.module+el8.9.0+1536+5f79634eRLSA-2025:7539
Alpinev3.15ruby-bundler2.2.33-r0ALPINE-CVE-2021-43809

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8ruby:2.5-8100020250506105643.489197e6Fixed 2025-05-14RHSA-2025:7539
Red Hat Enterprise Linux 7rubygem-bundlerOut of support scope
Red Hat Enterprise Linux 8ruby:3.0/rubyAffected
Red Hat Enterprise Linux 8ruby:3.1/rubyNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-43809.

Attack patterns (CAPEC)

  • CAPEC-41 Using Meta-characters in E-mail Headers to Inject Malicious Payloads Likelihood: High · Severity: High
  • CAPEC-88 OS Command Injection Likelihood: High · Severity: High
  • CAPEC-137 Parameter Injection Likelihood: Medium · Severity: Medium
  • CAPEC-174 Flash Parameter Injection Likelihood: High · Severity: Medium
  • CAPEC-460 HTTP Parameter Pollution (HPP) Severity: Medium

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON