Get a Demo
Under Attack?
A red and pink background with concentric circles features a white bug icon in the center. Text below reads: python-json-logger Supply Chain Remote Code Execution Vulnerability (CVE-2025-27607). Upwind logo is at the top right.

Supply Chain Remote Code Execution in python-json-logger CVE-2025-27607

<br />
<b>Warning</b>:  Undefined variable $photo in <b>/nas/content/live/landing173/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code</b> on line <b>24</b><br />
<br />
<b>Warning</b>:  Trying to access array offset on value of type null in <b>/nas/content/live/landing173/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code</b> on line <b>24</b><br />
Moshe Hassan March 10, 2025

A critical Remote Code Execution (RCE) vulnerability was recently discovered in python-json-logger, a widely used Python package for structured logging. This flaw, affecting versions 3.2.0 and 3.2.1, arises due to a missing dependency: msgspec-python313-pre. The package was deleted from PyPI, leaving its name unclaimed. This vulnerability highlights a recurring yet dangerous issue in software supply chains—dependency hijacking—where unclaimed or deleted packages can be re-registered by attackers to introduce malicious code.

What Makes python-json-logger Vulnerable?

The vulnerability exists because the package declares an optional dependency, msgspec-python313-pre, in its pyproject.toml file but does not ensure its presence on PyPI. This dependency was removed by its original owner, making it possible for an attacker to register a new package with the same name.

If a malicious actor published msgspec-python313-pre containing a payload, any developer running:

pip install python-json-logger[dev]

on Python 3.13 would automatically install the attacker’s package. This opens the door to arbitrary code execution during the installation or import of python-json-logger, depending on how the dependency is structured.

The issue persisted because, despite removing the dependency from the repository in commit 1ce81a3, no new version of python-json-logger was published to reflect this change until version 3.3.0. This left users of 3.2.0 and 3.2.1 vulnerable.

Exploitation Steps: How Attackers Could Leverage This

To demonstrate how this attack works, let’s break down the exploitation process:

The attacker gains remote code execution on the developer’s or CI/CD system.

  1. Identify a Missing Dependency:
    • Attackers scan popular packages for dependencies that do not exist on PyPI.
    • Using tools like pipreqs, they can list dependencies and check if any are missing.
  2. Register a Package with Malicious Code:
    • The attacker registers msgspec-python313-pre on PyPI 
    • Inside this package, they include a malicious setup.py script
    • Alternatively, they could embed the payload inside __init__.py so it executes on import.
  3. Wait for Victims to Install the Dependency:
    • Any user running pip install python-json-logger[dev] with Python 3.13 would automatically install the malicious package.
    • The attacker gains remote code execution on the developer’s or CI/CD system.

Real-World Impact: Why This Matters

According to PyPI BigQuery data, python-json-logger receives over 46 million downloads per month. This means that even a small percentage of users installing the dev dependencies could result in widespread compromise.

For organizations relying on CI/CD pipelines that install dependencies dynamically, this could lead to supply chain attacks, compromising sensitive environments and exfiltrating credentials, API keys, or even deploying malware at scale.

How Upwind Helps Detect and Mitigate Supply Chain Attacks

Upwind’s eBPF-based runtime monitoring provides real-time visibility into dependency installations and Python process behavior, helping organizations reduce noise and detect threats before exploitation occurs.

With Upwind, security teams can:

  1. Upwin SBOM explorer – Instantly locate vulnerable Python 3.13 runtimes and packages in your environment.
  2. Upwind Threat Detection Policies – Monitor pip installs to flag and block newly re-registered or suspicious dependencies.
  3. Vulnerability Management – Correlate package installs with runtime execution, reducing false positives.
  4. Upwind Map – Track network calls from pip to spot malicious domains before any payload can execute.

Upwind enables proactive security by combining static package analysis with runtime behavior detection, providing organizations with the full risk context needed to respond effectively.

Learn More

This vulnerability demonstrates the real-world risks of dependency hijacking and why organizations must closely monitor their software supply chains. By leveraging Upwind’s real-time monitoring, security teams can detect, investigate, and prevent supply chain threats before they lead to full-scale compromises. To learn more about how Upwind protects against dependency hijacking, schedule a demo.

Contents

Further Reading

bucket malware scanning

Upwind Launches Malware Scanning for Cloud Storage Across AWS, Azure, and GCP

Cloud object storage plays a central role in modern applications. Buckets are used to store application assets, exchange files, manage backups, build data pipelines, and share information across services and teams. That flexibility also makes object storage an attractive attack vector. A malicious file uploaded to a bucket can introduce risk into downstream applications, workloads,…
API-ASM Blog

Validate the Real-World Exposure of Your APIs with Upwind Attack Surface Management

Your APIs are probably the least-monitored component of your attack surface. They multiply faster than any team can document, and most scanners only ever pick up the ones you already know about. But that gap just got smaller. Upwind’s Attack Surface Management capabilities now provide a unified view of cloud and API exposure, helping security…
gemini-svg

Metabase Instances Actively Exploited: Unauthenticated Admin Takeover via BI Layer Reset Password SQL Injection (CVE-2026-72898)

Executive Summary Upwind recently observed multiple Advanced Persistent Threat (APT) groups actively exploiting CVE-2026-72898. This vulnerability - an unauthenticated SQL injection in the Metabase password reset endpoint carrying a critical CVSS score of 10.0, was actively exploited as a zero-day before a patch became available. An unauthenticated remote attacker can craft a malicious SQL injection…
Add the Upwind RSS Feed to Slack
Connect the Upwind RSS Feed to your Slack.
Follow the how-to here.
Threat RSS
Add the Upwind RSS Feed to Slack
Connect the Upwind RSS Feed to your Slack.
Follow the how-to here.
Main RSS