CVE-2026-5271 Possible to hijack modules in current working directory

Medium 5.6 Published Updated

Attackers can execute arbitrary code by placing malicious modules in the current working directory when users run pymanager commands.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2026-5271?

CVE-2026-5271 is a medium-severity code injection vulnerability in Python Software Foundation pymanager, published on 1 Apr 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

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

Weakness: CWE-427

Which versions are affected by CVE-2026-5271?

It affects 1 product.

Products include Python Pymanager.

How do I fix CVE-2026-5271?

No fix has been published for CVE-2026-5271 yet. Limit exposure of the affected software until one is available.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-5271 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-5271 exists.

Sources

Also known as GHSA-jr5x-hgm4-rrm6.

Is CVE-2026-5271 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free