Vulnerabilities in pkg:pypi/orjson

PACKAGE
Advisory Identifier: GHSA-hx9q-6w63-j58v
Advisory Summary

CVE-2025-67221 is a HIGH orjson does not limit recursion vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Orjson libraries in the PyPI ecosystem. The issue involves orjson does not limit recursion for deeply nested json documents. Remediation is available by upgrading affected packages to version 3.11.6.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/orjson

2 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-hx9q-6w63-j58v CVE-2025-67221 HIGH orjson does not limit recursion for deeply nested JSON documents
GHSA-pwr2-4v36-6qpr CVE-2024-27454 HIGH orjson does not limit recursion for deeply nested JSON documents

CVE-2025-67221 at a Glance

CVE Identifier CVE-2025-67221
GHSA Identifier GHSA-hx9q-6w63-j58v
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Orjson
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-67221

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

orjson fixed: 3.11.6
pip install orjson>=3.11.6
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 orjson

How to Check if You Are Affected

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

pip show orjson

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Orjson, 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

The orjson.dumps function in orjson before 3.11.6 does not limit recursion for deeply nested JSON documents.

CVE-2025-67221 Affected Orjson Versions

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

References

Frequently Asked Questions

What is CVE-2025-67221?
CVE-2025-67221 is a security vulnerability in Orjson involving orjson does not limit recursion for deeply nested JSON documents under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Orjson versions are affected?
Affected versions include releases prior to 3.11.6 across affected packages: orjson.
What version fixes CVE-2025-67221?
Upgrading to 3.11.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is orjson affected?
Yes, orjson is affected in releases prior to 3.11.6. Upgrade your dependency to 3.11.6 or later.
What CWE is associated with CVE-2025-67221?
CVE-2025-67221 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check PyPI dependencies for CVE-2025-67221?
Run the dependency tree command: 'pip show orjson'. 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-hx9q-6w63-j58v",
  "modified" : "2026-06-06T14:45:03Z",
  "published" : "2026-01-22T18:30:33Z",
  "aliases" : [ "CVE-2025-67221" ],
  "summary" : "orjson does not limit recursion for deeply nested JSON documents",
  "details" : "The orjson.dumps function in orjson before 3.11.6 does not limit recursion for deeply nested JSON documents.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "orjson"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.11.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-67221"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ijl/orjson/issues/620"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kpatsakis/CVE-2025-67221/issues/1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ijl/orjson/commit/62bb185b70785ded49c79c26f8c9781f1e6fe370"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ijl/orjson"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kpatsakis/orjson_vulnerability"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/orjson/PYSEC-2026-107.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-22T18:55:43Z",
    "nvd_published_at" : "2026-01-22T17:16:01Z"
  }
}