CVE-2026-68939
Received Received - Intake

Command Injection in Pyenv

Vulnerability report for CVE-2026-68939, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-18

Last updated on: 2026-08-18

Assigner: GitHub, Inc.

Description

Pyenv provides simple Python version management. Prior to 2.8.0, is_version_safe() in libexec/pyenv-version-file-read accepts shell glob metacharacters in .python-version values, and unquoted PYENV_VERSION expansion in libexec/pyenv-version-name, libexec/pyenv-which, libexec/pyenv-prefix, libexec/pyenv-local, libexec/pyenv-global, libexec/pyenv-version, and libexec/pyenv-versions pathname-expands the value against the current directory, allowing a matching attacker-controlled file to silently select a different installed interpreter or version. This issue is fixed in version 2.8.0.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-18
Last Modified
2026-08-18
Generated
2026-08-18
AI Q&A
2026-08-18
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
pyenv pyenv to 2.8.0 (inc)
pyenv pyenv 2.8.0

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-155 The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as wildcards or matching symbols when they are sent to a downstream component.
CWE-78 The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
CWE-88 The product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-68939 is a vulnerability in pyenv, a Python version manager. It involves glob/wildcard characters (like *, ?, []) in .python-version files bypassing version safety checks. When pyenv processes these files, unquoted expansions trigger pathname expansion, potentially redirecting to attacker-controlled versions. This can silently change the Python interpreter used, undermining pyenv's security.

Detection Guidance

Check for pyenv versions older than 2.8.0 by running: pyenv --version. Inspect .python-version files in projects for glob characters like *, ?, or []. Look for suspicious version strings in scripts like pyenv-version-name or pyenv-which.

Impact Analysis

An attacker could place malicious files in a project directory with names matching glob patterns in .python-version. If you clone an untrusted repo with such files, pyenv might use the wrong Python version. This could lead to executing unintended code with your user privileges. The impact is limited without additional conditions like write access to pyenv's versions directory.

Mitigation Strategies

Upgrade pyenv to version 2.8.0 or later. Disable pathname expansion in affected scripts by adding set -f before version processing and set +f after. Review .python-version files in repositories for glob patterns and remove any untrusted wildcards.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-68939. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart