CVE-2025-67221: orjson Package Suffers from Unrestricted Recursion in Deeply Nested JSON Documents

orjson Updated 22 Jan 2026

Summary

22/01/2026
No i
Moderate
5.5

CVE-2025-67221: orjson does not limit recursion for deeply nested JSON documents. Affects orjson versions < 3.11.4. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

orjson is a fast JSON serialization library for Python, designed to provide high performance and efficiency in converting Python objects to JSON format. It is widely used in applications that require quick data interchange and serialization. However, the library has a vulnerability that allows for unrestricted recursion when handling deeply nested JSON documents, which can lead to potential denial of service attacks.

Vulnerability Detail

The orjson.dumps function in orjson versions up to 3.11.4 does not impose limits on recursion depth for deeply nested JSON documents. This oversight can lead to excessive memory consumption and stack overflow errors, potentially crashing the application or causing denial of service. Attackers can exploit this vulnerability by crafting malicious JSON input that is deeply nested, leading to resource exhaustion and application instability.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, you can implement input validation to limit the depth of JSON documents before passing them to the orjson.dumps function. For example, you can create a function to check the depth of the JSON structure and raise an exception if it exceeds a certain threshold.

Conclusion

In summary, the orjson package has a vulnerability that allows for unrestricted recursion in deeply nested JSON documents, which can lead to denial of service. It is crucial to update to the latest version of orjson to mitigate this risk. Implementing input validation can also serve as a temporary workaround.

See every vulnerability recorded for orjson →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 5.5, indicating a moderate severity level.

The vulnerability affects orjson versions from 0 up to 3.11.4.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. You can check your application's status using the Vulert playground without any signup.

The potential consequences include denial of service due to excessive memory usage and application crashes caused by stack overflow errors.

Yes, you can implement input validation to limit the depth of JSON documents before processing them with orjson.

Related vulnerabilities

Recent vulnerabilities recorded for orjson.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback