{"id":"CVE-2026-42301","aliases":["GHSA-r35x-v8p8-xvhw","PYSEC-2026-3003"],"url":"https://o3.security/vulnerability/CVE-2026-42301","summary":"Improper Input Validation leading to Improper Control of Generation of Code ('Code Injection') in pyp2spec","details":"### Impact\npyp2spec 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.\n\nThe 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.\n\n### Patches\nPatched in 0.14.1.\n\n### Workarounds\nNone","published":"2026-05-09T03:59:34.741Z","modified":"2026-10-28T02:30:22.607037908Z","cvss":{"score":7.8,"severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"},"epss":{"score":0.00198,"percentile":0.09825,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"pyp2spec","fixedVersion":"0.14.1"}],"fix":null,"references":[{"type":"WEB","url":"https://github.com/befeleme/pyp2spec/releases/tag/v0.14.1"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/42xxx/CVE-2026-42301.json"},{"type":"ADVISORY","url":"https://github.com/befeleme/pyp2spec/security/advisories/GHSA-r35x-v8p8-xvhw"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42301"},{"type":"PACKAGE","url":"https://github.com/befeleme/pyp2spec"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:22.607037908Z"}}