Vulnérabilité dans bundler (CVE-2021-43809)
Résumé
Vulnérabilité dans bundler (CVE-2021-43809). L'exploitation peut entraîner la prise de contrôle totale du système. Exploitable via bundler. Atténuation : mise à jour vers 2.2.33 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
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.
Exploitation
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 [u…
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
Résumé généré automatiquement
Assemblé par SecPulse à partir des données sources (CVSS, CWE, versions affectées) à l'aide de modèles, sans IA. Vérifiez la description d'origine et les références ci-dessous.
Une vulnérabilité référencée CVE-2021-43809 a été découverte dans bundler.
Des attaquants peuvent cibler un point d'entrée spécifique comme bundler à distance pour détourner le produit.
L'exploitation peut entraîner la prise de contrôle totale du système.
Action : mettez à jour bundler vers 2.2.33 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « bundler CVE-2021-43809 » sur le site de l'éditeur.
CVE-2021-43809 (bundler) — CWE-88
Vecteur d'attaque : local
Surface d'attaque : bundler / Gemfile / gem / git
Correctif : 2.2.33 — appliquer immédiatement
Contournement : 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.
Plan : 1) Audit SBOM, 2) Mise à jour staging→prod, 3) Surveillance WAF/proxy sur les endpoints affectés, 4) Recherche d'IOC dans les logs.
Réfs : voir GHSA / avis éditeur / version corrigée liés sur cette page.
Une vulnérabilité (CWE-88) affecte bundler. Les attaquants atteignent le code vulnérable via bundler.
Consultez l'avis de l'éditeur pour les versions affectées de bundler. Surface d'attaque : bundler / Gemfile / gem / git.
Gravité : ?. L'exploitation peut entraîner la prise de contrôle totale du système.
Mettre à jour vers 2.2.33.
Contournement : 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.
Recherchez dans les logs des requêtes correspondant aux IOC connus de cette CVE. Auditez les SBOM/dépendances.
Actions de réponse
Étapes concrètes et exemples de commandes que les équipes SOC/SRE doivent exécuter dans l'ordre
-
1Identify exposure identify
grep -r 'bundler' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
bundlerを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
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.パッチが適用されるまでの応急処置として、Regardless of whether users can upgrade or not, they should review any untrustred
Gemfile's before running anybundlercommands that may read them, since they can contain arbitrary ruby code. を実施。回避策の副作用 (機能低下) を確認した上で。 -
3Apply patch patch
Upgrade bundler to 2.2.33ステージング環境で 2.2.33 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Paquets affectés
État des correctifs par distribution
Paquets corrigés publiés par chaque distribution pour cette CVE
- Alpine Linux ALPINE-CVE-2021-43809 ruby-bundler Corrigé dans: 2.2.33-r0
- Debian DEBIAN-CVE-2021-43809 rubygems Corrigé dans: 3.3.5-1
Références
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web lists.debian.org
- web sonarsource.com