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

- Severity: High 7.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.20%, higher than 10% of CVEs (2026-12-01)
- Published: 2026-05-04T20:14:38.000Z
- Modified: 2026-07-24T21:10:00.143Z
- Also known as: GHSA-r35x-v8p8-xvhw, PYSEC-2026-3003
- Weaknesses: CWE-20, CWE-94
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- befeleme pyp2spec: < 0.14.1
- pyp2spec (PyPI): before 0.14.1

## Every score

- GitHub_M: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://github.com/befeleme/pyp2spec/security/advisories/GHSA-r35x-v8p8-xvhw> (web)
- <https://github.com/befeleme/pyp2spec/releases/tag/v0.14.1> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-42301> (advisory)
- <https://github.com/befeleme/pyp2spec> (package)
- <https://pypi.org/project/pyp2spec> (package)
- <https://github.com/advisories/GHSA-r35x-v8p8-xvhw> (advisory)

## Sources

- CVE List: [CVE-2026-42301](https://www.cve.org/CVERecord?id=CVE-2026-42301), CVE Terms of Use, modified 2026-05-11
- GitHub Advisory Database: [GHSA-r35x-v8p8-xvhw](https://github.com/advisories/GHSA-r35x-v8p8-xvhw), CC-BY-4.0, modified 2026-07-13
- NVD: [CVE-2026-42301](https://nvd.nist.gov/vuln/detail/CVE-2026-42301), Public domain, modified 2026-07-24
- PyPA Advisory Database: [PYSEC-2026-3003](https://osv.dev/vulnerability/PYSEC-2026-3003), CC-BY-4.0, modified 2026-07-13

---

Page: https://cve.day/CVE-2026-42301 · Whole record: https://cve.day/CVE-2026-42301.json · Rebuilt by cve.day 2026-11-25T22:59:21.138Z
