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

ArgoCD repoURL XSS

ArgoCD repoURL XSS: How a Missing Scheme Check Becomes Cluster Takeover (CVE-2026-62341)

Executive Summary  CVE-2026-62341 is a stored cross-site scripting (XSS) vulnerability in ArgoCD [versions <= 3.4.6] that lets an attacker who can create or modify an Application persist a malicious repoURL, which then executes in an administrator's browser inside the ArgoCD origin. Because the payload rides the admin's authenticated session, and because ArgoCD's controller typically runs…
The Risk Isn't What You Prompt, It's What You Built.

The Risk Isn’t What You Prompt, It’s What You Built

Key Takeaways: Agentic AI security is an architecture problem, not a policy problem. Most organizations have adopted AI agents in the form of coding assistants, autonomous workflow tools, internal chatbots connected to production systems, but without establishing the foundational security frameworks those systems require. The adoption pressure is real. Telling your engineering team to stop…
Upwind is a Visionary Leader in Frost & Sullivan report

Upwind Named a Strong Visionary Leader in Frost & Sullivan’s 2026 Cloud/Application Runtime Security Radar

We're excited to share that Frost & Sullivan has recognized Upwind as a Strong Visionary Leader in the Frost Radar™: Cloud/Application Runtime Security, 2026. This recognition highlights the company's innovation, growth, and leadership in the emerging Cloud-Native Application Detection and Response (CNADR) market. For us, the recognition is meaningful not simply because of where Upwind…
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