The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-42301

CVE-2026-42301: pyp2spec RCE Vulnerability

CVE-2026-42301 is a remote code execution flaw in pyp2spec that allows malicious packages to execute arbitrary commands during RPM builds. This post covers technical details, affected versions, and mitigation.

Published: May 18, 2026

CVE-2026-42301 Overview

CVE-2026-42301 is an input validation vulnerability [CWE-20] in pyp2spec, a tool that generates Fedora RPM spec files from Python projects on the Python Package Index (PyPI). Versions prior to 0.14.1 write PyPI package metadata, such as the summary field, directly into the generated spec file without escaping RPM macro directives. When a packager runs rpmbuild against the generated spec, the embedded macros execute as part of the build process. A malicious PyPI package can therefore execute arbitrary commands on the packager's build machine. The issue is patched in pyp2spec version 0.14.1.

Critical Impact

A crafted PyPI package can achieve arbitrary command execution on a Fedora packager's build host once the generated spec file is processed by rpmbuild.

Affected Products

  • pyp2spec versions prior to 0.14.1
  • Fedora packaging workflows that consume pyp2spec-generated spec files
  • Build hosts running rpmbuild against untrusted PyPI metadata

Discovery Timeline

  • 2026-05-09 - CVE-2026-42301 published to the National Vulnerability Database (NVD)
  • 2026-05-13 - Last updated in NVD database

Technical Details for CVE-2026-42301

Vulnerability Analysis

pyp2spec automates the creation of RPM spec files for Python packages by pulling metadata directly from PyPI. The tool copies fields such as the project summary into spec file directives without sanitizing RPM macro syntax. RPM macros use the %{...} and %(...) constructs, where %(...) instructs rpmbuild to execute a shell command and inline its output. When a malicious package author embeds a macro expression into a metadata field, that expression is written verbatim into the spec file. The downstream packager then invokes rpmbuild, which evaluates the macros and runs the attacker's commands under the packager's account. This is a classic injection pattern where untrusted upstream data crosses into a code-evaluation context.

Root Cause

The root cause is missing output encoding when serializing PyPI metadata into RPM spec directives. pyp2spec treats PyPI fields as inert text, but rpmbuild interprets % sequences as macro expansions. Without escaping the % character or rejecting macro-bearing metadata, the tool allows attacker-controlled input to influence build-time execution.

Attack Vector

Exploitation requires user interaction from a Fedora packager. The attacker publishes a PyPI package whose metadata contains RPM macro directives, such as a summary value that includes %(...). The packager runs pyp2spec against the package to generate a spec file. When the packager subsequently executes rpmbuild on that spec, the embedded macro executes with the packager's privileges on the local build host. The CVSS vector CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H reflects this local, user-interaction-dependent path with full impact on confidentiality, integrity, and availability.

No verified exploit code is publicly available. Technical specifics are documented in the GitHub Security Advisory GHSA-r35x-v8p8-xvhw.

Detection Methods for CVE-2026-42301

Indicators of Compromise

  • Generated .spec files containing unexpected %(...) shell-evaluation macros inside metadata fields such as Summary: or %description.
  • rpmbuild invocations spawning unexpected child processes such as sh, curl, wget, or python during the spec parsing phase.
  • Outbound network connections initiated from build hosts during what should be offline metadata processing.

Detection Strategies

  • Statically scan pyp2spec-produced spec files for the %( sequence in metadata-derived fields before passing them to rpmbuild.
  • Audit installed pyp2spec versions across packaging workstations and continuous integration runners and flag any version below 0.14.1.
  • Correlate PyPI package ingestion events with subsequent process execution on build hosts to identify anomalous command chains.

Monitoring Recommendations

  • Enable process-creation logging on packager workstations and CI builders to capture child processes of rpmbuild.
  • Monitor egress traffic from build environments and alert on connections that do not match expected mirrors or package repositories.
  • Track changes to the pyp2spec package version in build images and require version 0.14.1 or later as a baseline.

How to Mitigate CVE-2026-42301

Immediate Actions Required

  • Upgrade pyp2spec to version 0.14.1 or later on every system that generates Fedora spec files.
  • Review any spec files generated by vulnerable versions and inspect metadata fields for %(...) or other macro constructs before building.
  • Rebuild and re-verify packages that were produced with vulnerable pyp2spec versions from untrusted PyPI sources.

Patch Information

The maintainer released the fix in pyp2spec v0.14.1, which escapes RPM macro directives in PyPI-sourced metadata. Coordinated disclosure details are available in the GitHub Security Advisory GHSA-r35x-v8p8-xvhw.

Workarounds

  • Manually inspect generated spec files and remove or escape any % sequences originating from PyPI metadata before invoking rpmbuild.
  • Run pyp2spec and rpmbuild inside an isolated, ephemeral build environment such as a container or mock chroot to contain potential command execution.
  • Restrict packaging workflows to vetted PyPI packages until the upgrade to 0.14.1 is deployed across all build hosts.
bash
# Upgrade pyp2spec to the patched release
pip install --upgrade 'pyp2spec>=0.14.1'

# Verify the installed version
pyp2spec --version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechPyp2spec

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.03%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-20
  • Technical References
  • GitHub Release v0.14.1

  • GitHub Security Advisory GHSA-r35x-v8p8-xvhw
  • Latest CVEs
  • CVE-2026-43328: Linux Kernel Use-After-Free Vulnerability

  • CVE-2026-43329: Linux Kernel Netfilter DoS Vulnerability

  • CVE-2026-43330: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-43331: Linux Kernel DOS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English