{"id":"CVE-2026-42301","title":"pyp2spec: pyp2spec: Arbitrary command execution via unescaped RPM macro directives (CVE-2026-42301)","summary":"A flaw was found in pyp2spec, a tool that generates Fedora RPM spec files for Python projects. This vulnerability allows a malicious Python Package Index (PyPI) package to execute arbitrary commands on a build machine. This occurs because …","severity":"high","cvss":7.3,"cvssVector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H","cvssSource":"vendor","vendor":"Red Hat","product":"pyp2spec","affected":["pyp2spec < 0.14.1"],"patched":["pyp2spec 0.14.1"],"published":"2026-05-09","updated":"2026-09-18","sourceUpdated":"2026-09-18T18:02:37+00:00","source":"CSAF","sourceUrl":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42301.json","references":[{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42301.json"},{"url":"https://access.redhat.com/security/cve/CVE-2026-42301"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-42301"},{"url":"https://github.com/befeleme/pyp2spec/security/advisories/GHSA-r35x-v8p8-xvhw"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42301"},{"url":"https://github.com/befeleme/pyp2spec"},{"url":"https://github.com/befeleme/pyp2spec/releases/tag/v0.14.1"}],"tags":["csaf","vex","red-hat","osv","pip"],"epss":0.00198,"epssPercentile":0.09833,"aliases":["GHSA-r35x-v8p8-xvhw","PYSEC-2026-3003"],"ecosystem":"pip","scores":{"vendor":7.3,"osv":7.8},"ingestedAt":"2026-07-13T18:58:02.365Z","slug":"CVE-2026-42301","body":"## Overview\n\nA flaw was found in pyp2spec, a tool that generates Fedora RPM spec files for Python projects. This vulnerability allows a malicious Python Package Index (PyPI) package to execute arbitrary commands on a build machine. This occurs because pyp2spec writes PyPI package metadata, such as the summary field, into the generated spec file without properly escaping RPM macro directives. When a packager subsequently runs rpmbuild, these unescaped directives are evaluated, leading to the execution of arbitrary commands.\n\n## Vendor advisories\n\n- **Red Hat VEX** · updated 2026-09-18 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42301.json)\n\n**pyp2spec: pyp2spec: Arbitrary command execution via unescaped RPM macro directives**. Released 2026-05-09, updated 2026-09-18.\n\nNot affected:\n\n- All currently supported Red Hat products\n\n## Remediation\n\nRefer to the advisory for fix availability.\n\n## Package advisory (CVE-2026-42301)\n\nAffected packages:\n\n- `pyp2spec < 0.14.1`\n\nPatched in:\n\n- `pyp2spec 0.14.1`\n\nSource: https://osv.dev/vulnerability/GHSA-r35x-v8p8-xvhw","depth":"twilight","depthScore":40,"depthScoreParts":{"impact":40.2,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[{"seq":208146,"id":"CVE-2026-42301","ts":1789922725292,"field":"cvss","old":"7.8","new":"7.3"}]}