Vulnerabilities in pkg:pypi/pyp2spec

PACKAGE
Advisory Identifier: GHSA-r35x-v8p8-xvhw
Advisory Summary

CVE-2026-42301 is a HIGH (CVSS 7.8) pyp2spec is vulnerable to code vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Pyp2spec libraries in the PyPI ecosystem. The issue involves pyp2spec is vulnerable to code injection. Remediation is available by upgrading affected packages to version 0.14.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/pyp2spec

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/pyp2spec. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-r35x-v8p8-xvhw CVE-2026-42301 HIGH pyp2spec is Vulnerable to Code Injection

CVE-2026-42301 at a Glance

CVE Identifier CVE-2026-42301
GHSA Identifier GHSA-r35x-v8p8-xvhw
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Pyp2spec
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-42301

To remediate this vulnerability, upgrade all affected Pyp2spec dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pyp2spec fixed: 0.14.1
pip install pyp2spec>=0.14.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pyp2spec

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-42301, inspect your installed packages using pip:

pip show pyp2spec

Analyze the terminal output to locate any version of Pyp2spec in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.14.1), your application is affected.

Note: The pip show pyp2spec command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Pyp2spec, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-42301 Affected Pyp2spec Versions

1 component(s)
Fixed Versions:
0.14.1
Product / Package Ecosystem Affected Versions Fixed Version
pyp2spec
PyPI
< 0.14.1
0.14.1

References

Frequently Asked Questions

What is CVE-2026-42301?
CVE-2026-42301 is a security vulnerability in Pyp2spec involving pyp2spec is Vulnerable to Code Injection under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Pyp2spec versions are affected?
Affected versions include releases prior to 0.14.1 across affected packages: pyp2spec.
What version fixes CVE-2026-42301?
Upgrading to 0.14.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pyp2spec affected?
Yes, pyp2spec is affected in releases prior to 0.14.1. Upgrade your dependency to 0.14.1 or later.
What is the CVSS score of CVE-2026-42301?
CVE-2026-42301 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-42301?
CVE-2026-42301 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check PyPI dependencies for CVE-2026-42301?
Run the dependency tree command: 'pip show pyp2spec'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r35x-v8p8-xvhw",
  "modified" : "2026-05-13T13:39:32Z",
  "published" : "2026-05-04T20:14:38Z",
  "aliases" : [ "CVE-2026-42301" ],
  "summary" : "pyp2spec is Vulnerable to Code Injection",
  "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",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pyp2spec"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.14.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "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"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/befeleme/pyp2spec/releases/tag/v0.14.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-04T20:14:38Z",
    "nvd_published_at" : "2026-05-09T04:16:25Z"
  }
}