# CVE-2025-27607: Python JSON Logger has a Potential RCE via missing `msgspec-python313-pre` dependency

> Attackers could execute code on systems installing development dependencies for Python JSON Logger due to a hijacked package name.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 7 Mar 2025
- **Updated:** 7 Mar 2025
- **Also known as:** GHSA-wmxh-pxcx-9w24, UBUNTU-CVE-2025-27607

## What is CVE-2025-27607?

CVE-2025-27607 is a high-severity vulnerability in nhairs python-json-logger, published on 7 Mar 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Python JSON Logger is a JSON Formatter for Python Logging. Between 30 December 2024 and 4 March 2025 Python JSON Logger was vulnerable to RCE through a missing dependency. This occurred because msgspec-python313-pre was deleted by the owner leaving the name open to being claimed by a third party. If the package was claimed, it would allow them RCE on any Python JSON Logger user who installed the development dependencies on Python 3.13 (e.g. pip install python-json-logger[dev]). This issue has been resolved with 3.3.0.

Weakness: CWE-829 (Inclusion of Functionality from Untrusted Control Sphere)

## Which versions are affected by CVE-2025-27607?

It affects 1 product.


Products: Nhairs Python Json Logger.

## How do I fix CVE-2025-27607?

No fix has been published for CVE-2025-27607 yet. Limit exposure of the affected software until one is available.

## Is CVE-2025-27607 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-27607 exists.

Public exploit code:

- CVE-2025-27607 fix (github_poc): https://github.com/Barsug/msgspec-python313-pre

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-27607 and fix it if it is affected.

What it is: CVE-2025-27607 is a high-severity vulnerability in nhairs python-json-logger, published on 7 Mar 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-27607 exists.

Affected product: nhairs python-json-logger. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-27607/ (Markdown: https://insights.sbomify.com/CVE-2025-27607/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-27607
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-27607
- OSV: https://osv.dev/vulnerability/CVE-2025-27607

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-27607/
Summaries are generated and may contain mistakes; the official description above is the record.
