Advisory

PYSEC-2026-3003

Also known as: CVE-2026-42301, GHSA-r35x-v8p8-xvhw

Summary

pyp2spec is Vulnerable to Code Injection

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

Severity

High Basis: CVSS v3 score 7.8, vector CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Dates

Published
2026-07-13 15:02 UTC
Modified
2026-07-13 16:33 UTC

Affected packages and fixes

pyp2spec

PyPI · All systems

Affected

  • introduced 0, fixed 0.14.1 (ecosystem)

Fixed versions

0.14.1

Fix

  • Fixed version 0.14.1
    pip install --upgrade pyp2spec==0.14.1

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences