CVE-2026-42301 Improper Input Validation leading to Improper Control of Generation of Code ('Code Injection') in pyp2spec

High 7.8 Published Updated

Attackers can execute arbitrary commands on build machines by injecting RPM macros into PyPI metadata processed by pyp2spec.

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
Available

What is CVE-2026-42301?

CVE-2026-42301 is a high-severity code injection vulnerability in befeleme pyp2spec, published on 9 May 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

pyp2spec generates working Fedora RPM spec file for Python projects. Prior to version 0.14.1, pyp2spec was writing PyPI package metadata (e.g. the summary field) into the generated spec file without escaping RPM macro directives. When a packager then runs rpmbuild, those directives get evaluated, so a malicious package can execute arbitrary commands on the build machine. This issue has been patched in version 0.14.1.

Weakness: CWE-94, CWE-20

Which versions are affected by CVE-2026-42301?

3 open source packages ship an affected version, including pyp2spec.

PackageAffectedFixed in
pyp2spec PyPIAll versions0.14.1
pyp2spec PyPIAll versions0.14.1
pyp2spec PyPIAll versions0.14.1

How do I fix CVE-2026-42301?

Upgrade pyp2spec to 0.14.1 or later.

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

Is CVE-2026-42301 being exploited?

There is no known exploitation of CVE-2026-42301 in the wild and no public exploit code.

Sources

Also known as GHSA-r35x-v8p8-xvhw, PYSEC-2026-3003.

Is CVE-2026-42301 in your software?

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

Check your SBOMs for free