Vulnérabilité dans virtualenv (CVE-2026-102938)
Résumé
Vulnérabilité dans virtualenv (CVE-2026-102938). Risque d'opérations non autorisées ou de divulgation. Exploitable via pyvenv.cfg. Atténuation : mise à jour vers 21.7.11 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
Summary
pyvenv.cfg is a line-based format with no escape syntax. PyEnvCfg.write() wrote values verbatim, while PyEnvCfg._read_values() parses the file with str.splitlines(). A value containing a line boundary therefore became additional configuration lines, and because reading is last-wins, the injected keys replaced any key written earlier in the file.
Impact
The prompt value is the reachable input: it is set by --prompt, by the VIRTUALENV_PROMPT environment variable, or from the config file, and write() emits prompt before home. A crafted prompt can therefore set home in the generated pyvenv.cfg:
$ virtualenv --prompt $'x"\nhome = /attacker/path\nprompt = "z' venv
$ grep '^home' venv/pyvenv.cfg
home = /attacker/path
home is what tooling reads to locate the base interpreter, so a consumer that trusts it can be pointed elsewhere. implementation, version_info, version, executable, command and virtualenv are also written before prompt and can be replaced the same way.
This requires the prompt to come from somewhere other than the person running the command, for example a CI job templating a branch name into it, tooling deriving an environment name from user-supplied data, or an inherited VIRTUALENV_PROMPT. Where the operator supplies the prompt directly they already control the command line, and the effect is corruption rather than privilege gain: the value is truncated at the boundary and read back with a d…
Source: NIST National Vulnerability Database NVD GitHub Advisory
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-2026-102938 a été découverte dans virtualenv.
Des attaquants peuvent cibler un point d'entrée spécifique comme pyvenv.cfg à distance pour détourner le produit.
Risque d'opérations non autorisées ou de divulgation.
Action : mettez à jour virtualenv vers 21.7.11 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « virtualenv CVE-2026-102938 » sur le site de l'éditeur.
CVE-2026-102938 (virtualenv) — CWE-93
Surface d'attaque : pyvenv.cfg / prompt / VIRTUALENV_PROMPT / home
Correctif : 21.7.11 — appliquer immédiatement
Contournement : Do not pass externally influenced data as the virtualenv prompt.
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-93) affecte virtualenv. Les attaquants atteignent le code vulnérable via pyvenv.cfg.
Consultez l'avis de l'éditeur pour les versions affectées de virtualenv. Surface d'attaque : pyvenv.cfg / prompt / VIRTUALENV_PROMPT / home.
Gravité : ?. Risque d'opérations non autorisées ou de divulgation.
Mettre à jour vers 21.7.11.
Contournement : Do not pass externally influenced data as the virtualenv prompt.
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 'virtualenv' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
virtualenvを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
Do not pass externally influenced data as the virtualenv prompt.パッチが適用されるまでの応急処置として、Do not pass externally influenced data as the virtualenv prompt. を実施。回避策の副作用 (機能低下) を確認した上で。
-
3Apply patch patch
Upgrade virtualenv to 21.7.11ステージング環境で 21.7.11 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Paquets affectés
Références
- web github.com
- web github.com
- web github.com
- web github.com
- web nvd.nist.gov
- web github.com
- web pypi.org
- web github.com