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

Exp

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

公開: 2021-12-08 最終更新: 2026-06-17 Assigner: [email protected] ソース: [email protected]

総合評価: CVE-2021-43809 は悪用リスクが高い(72.6/100)。CVSS 深刻度は中。悪用される可能性が高い(EPSS 2.80%、85 パーセンタイル) 根拠: 公開エクスプロイトが 2 件参照されています(Exploit-DB)。 直近 1 日で EPSS が +1.24% 上昇。悪用への関心が高まっている可能性があります。 推奨対応: 公開エクスプロイトが確認されています。影響範囲の確認、緩和策の適用、パッチ適用を優先してください。

リスクは変動します。再評価に基づき、本ページの表示内容を更新しています。

CVE-2021-43809 に関する公開 exploit 参照(Exploit-DB)

EDB-ID ソース 種別 公開 リンク
nvd_ref exploit_tag Exploit-DB ↗
nvd_ref exploit_tag Exploit-DB ↗

CVE-2021-43809 の EPSS(Exploit Prediction Scoring System)スコア

EPSS は日次で悪用されやすさの相対度合いを推定します。パーセンタイルは採点済み CVE の中での相対位置(高いほど相対的に深刻)を示します。

# 日付 旧 EPSS スコア 新 EPSS スコア Δ(新 − 旧)
1 2026-06-15 1.55% 2.80% +1.24%
2 2026-04-24 1.32% 1.55% +0.23%
3 2026-04-19 1.32%

EPSS の全履歴 (全 31 件)

CVE-2021-43809 の CVSS(Common Vulnerability Scoring System)指標

この CVE の CVSS 指標。

ベーススコア バージョン 深刻度 ベクトル 悪用しやすさ 影響 スコアの出典
6.7 3.1 MEDIUM
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H クリックして展開
攻撃ベクター (AV:L)
対象ホスト上でコードを実行できること、または別ユーザーの誤操作・悪意ある操作が前提になる。
攻撃の複雑さ (AC:H)
到達できても、タイミング・負荷・周辺設定など、揃わないと成功しない局面が多い。
必要な権限 (PR:L)
一般ユーザー権限があれば足り、管理者(root 相当)は不要。
ユーザーの関与 (UI:R)
インストールの許可、設定変更、悪意あるファイルの実行など、人の一度の判断がトリガーになる。
スコープ (S:U)
影響は脆弱コンポーネントと同一のセキュリティ権限・信頼境界の内側に収まる。
機密性への影響 (C:H)
広範な機微データの読み取りや持ち出しが現実的。
完全性への影響 (I:H)
権限の奪取や広範なログ改竄など、システムの信頼根拠を揺るがす改ざんが現実的。
可用性への影響 (A:H)
長時間のサービス停止、データ損壊による復旧不能に近い状態など、利用者に著しい不便を与えうる。
0.8 5.9 [email protected]
7.3 3.1 HIGH
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H クリックして展開
攻撃ベクター (AV:L)
対象ホスト上でコードを実行できること、または別ユーザーの誤操作・悪意ある操作が前提になる。
攻撃の複雑さ (AC:L)
攻撃者が条件を満たせば、レース条件や珍しい構成に依存せずに再現しやすい。
必要な権限 (PR:L)
一般ユーザー権限があれば足り、管理者(root 相当)は不要。
ユーザーの関与 (UI:R)
インストールの許可、設定変更、悪意あるファイルの実行など、人の一度の判断がトリガーになる。
スコープ (S:U)
影響は脆弱コンポーネントと同一のセキュリティ権限・信頼境界の内側に収まる。
機密性への影響 (C:H)
広範な機微データの読み取りや持ち出しが現実的。
完全性への影響 (I:H)
権限の奪取や広範なログ改竄など、システムの信頼根拠を揺るがす改ざんが現実的。
可用性への影響 (A:H)
長時間のサービス停止、データ損壊による復旧不能に近い状態など、利用者に著しい不便を与えうる。
1.3 5.9 [email protected]
9.3 2.0 HIGH
AV:N/AC:M/Au:N/C:C/I:C/A:C クリックして展開
アクセス経路 (AV:N)
ルーティング可能なネットワーク越しに、遠隔から到達・悪用しうる。
アクセスの複雑さ (AC:M)
多少の有利条件は要るが、極端なレアケースではない。
認証 (AU:N)
認証を経ずに攻撃を完結できる。
機密性への影響 (C:C)
機密性は全面的に損なわれる。
完全性への影響 (I:C)
完全性は全面的に損なわれる。
可用性への影響 (A:C)
可用性は全面的に損なわれる。
8.6 10.0 [email protected]

CVE-2021-43809 の弱点分類(列挙)

CVE-2021-43809 の GitHub Security Advisory

GHSA-fj7f-vq84-fh43 · 深刻度: medium · エコシステム: rubygems — Local Code Execution through Argument Injection via dash leading git url parameter in Gemfile.

CVE-2021-43809 の OS トラッカー

vendor priority summary link
alpine CVE-2021-43809: 1 source package rows (ruby-bundler); 1 state rows across 1 repos (3.12-main); fixed 0, open 1. https://security.alpinelinux.org/vuln/CVE-2021-43809
debian not yet assigned CVE-2021-43809 not yet assigned priority: Debian including 1 source packages (rubygems), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2021-43809
gentoo normal CVE-2021-43809: 1 GLSA(s) (202408-22), 1 atom(s) (dev-ruby/bundler); latest impact normal. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2021-43809
redhat medium https://access.redhat.com/security/cve/CVE-2021-43809
suse high CVE-2021-43809 severity important: SUSE including 268 source package names (2.19-54.2:ruby2.5-rubygem-bundler-1.16.1-150000.3.6.1, 2.5-29.2:ruby2.5-rubygem-bundler-1.16.1-150000.3.6.1, …), 338 product×package rows across 75 product lines (Container bci/ruby, Container suse/rmt-server, … (75 product lines)): Known Affected 231, Fixed 107. https://www.suse.com/security/cve/CVE-2021-43809/
ubuntu medium CVE-2021-43809 medium priority: Ubuntu including 1 source packages (bundler), 15 status rows across 15 suites (bionic, focal, hirsute, impish, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): DNE 9, ignored 2, needed 2, needs-triage 2. https://ubuntu.com/security/CVE-2021-43809

CVE-2021-43809 の影響を受けるソフトウェア/構成

ベンダー 製品 バージョン 生の CPE
bundler bundler < 2.2.33 cpe:2.3:a:bundler:bundler:*:*:*:*:*:ruby:*:*

CVE-2021-43809 の参考情報

cvelogic Threat Intelligence