VDB
Sign up
HIGH7.8

PYSEC-2026-3003

pyp2spec is Vulnerable to Code Injection

Quick fix

PYSEC-2026-3003 — pyp2spec: upgrade to the fixed version with the command below.

pip install --upgrade 'pyp2spec>=0.14.1'

Details

### Impact 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.

The macro evaluates during spec parsing, not only during the build step. Any rpm tool touching the generated spec triggers execution, `rpmbuild -bs`, `rpmbuild --nobuild`, `rpm -q --specfile`, so the victim doesn't need to commit to a full build before getting compromised. The realistic attack path is typosquatting or targeting a package known to be under Fedora review rather than drive-by publishing. Fedora packagers hold dist-git SSH keys, Koji build credentials, and Bodhi update credentials, so compromise of one packager's workstation enables committing malicious source to dist-git and riding it through the normal build pipeline to end users.

### Patches Patched in 0.14.1.

### Workarounds None

Are you affected?

Enter the version of the package you're using.

Affected packages

PyPI/pyp2spec
Introduced in: 0Fixed in: 0.14.1
Fixpip install --upgrade 'pyp2spec>=0.14.1'

References