CVE-2026-5271

Possible to hijack modules in current working directory

Published Apr 1, 2026 CVSS 4.0 · 5.6 Medium EPSS < 1% KEV · Not listed
Description
pymanager included the current working directory in sys.path meaning modules could be shadowed by modules in the current working directory. As a result, if a user executes a pymanager-generated command (e.g., pip, pytest)
from an attacker-controlled directory, a malicious module in that
directory can be imported and executed instead of the intended package.

Analysis

AI-generated

Technical impact

pymanager adds the current working directory to the Python import path, allowing a local file with the same name as a legitimate module to shadow the intended package. When a user runs a pymanager‑generated command such as pip or pytest from an attacker‑controlled directory, the malicious module can be imported and executed under the user’s privileges. This represents an arbitrary code execution risk and is classified under CWE‑427 (Uncontrolled Search Path Elements).

Affected Systems

The vulnerability affects the Python Software Foundation’s pymanager, specifically version 26.0 and earlier releases. Any installation of these versions that may be invoked from an untrusted working directory is at risk. Administrators should verify the version of pymanager in use and consider the impact if the tool is executed in directories that may be controlled by untrusted parties.

Risk and Exploitability

The CVSS score of 5.6 indicates moderate damage potential, while an EPSS score of less than 1% suggests the vulnerability is currently unlikely to be exploited widely. The vulnerability is not listed in the CISA KEV catalog and no public exploit has been documented. Exploitation requires the attacker to have write access to the working directory and to trigger a pymanager command while executing from that location. The attack can execute arbitrary code with the privileges of the user launching the command. The risk is thus primarily confined to environments where pymanager is run from directories that can be influenced by external or third‑party input.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade pymanager to a version where the issue is resolved.
  • If an upgrade is not immediately possible, run pymanager commands from a directory that is not under attacker control or change to a safe directory before execution.
  • Adjust PYTHONPATH to exclude the current working directory so that local modules are not considered during import.

Generated by OpenCVE AI on April 7, 2026 at 23:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:python:pymanager:26.0:*:*:*:*:*:*:*
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
First Time appeared Python
Python pymanager
Vendors & Products Python
Python pymanager
Type Values Removed Values Added
Description pymanager included the current working directory in sys.path meaning modules could be shadowed by modules in the current working directory. As a result, if a user executes a pymanager-generated command (e.g., pip, pytest) from an attacker-controlled directory, a malicious module in that directory can be imported and executed instead of the intended package.
Title Possible to hijack modules in current working directory
Weaknesses CWE-427
References
Metrics cvssV4_0

{'score': 5.6, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Weaknesses
  • CWE-427

    Uncontrolled Search Path Element

Sources

Status
PUBLISHED
Assigner
PSF
Published
Updated
Apr 1, 2026, 11:12 PM
Reserved
Mar 31, 2026, 8:02 PM
Status
Analyzed
Published
Apr 1, 2026, 2:16 PM
Modified
Oct 26, 2026, 9:10 PM