# CVE-2024-27454: orjson does not limit recursion for deeply nested JSON documents

> Attackers can cause denial of service in applications using orjson by submitting deeply nested JSON documents that trigger excessive recursion.

- **Severity:** High 7.5 (`CVSS:3.1/AC:L/AV:N/A:H/C:N/I:N/PR:N/S:U/UI:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Feb 2024
- **Updated:** 2 Aug 2024
- **Also known as:** CLSA-2026-1787140595, DEBIAN-CVE-2024-27454, ECHO-858e-faea-85ef, GHSA-pwr2-4v36-6qpr, PYSEC-2024-40, ROOT-APP-PYPI-CVE-2024-27454, openSUSE-SU-2024:13735-1, openSUSE-SU-2024:13780-1, openSUSE-SU-2026:12024-1, openSUSE-SU-2026:12033-1

## What is CVE-2024-27454?

CVE-2024-27454 is a high-severity denial of service vulnerability in n/a, published on 26 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

orjson.loads in orjson before 3.9.15 does not limit recursion for deeply nested JSON documents.

Weakness: CWE-674 (Uncontrolled Recursion)

## Which versions are affected by CVE-2024-27454?

3 open source packages ship an affected version, including orjson. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `orjson` | PyPI | All versions | 3.9.15 |
| `orjson` | PyPI | All versions | 3.9.15 |
| `orjson` | PyPI | All versions | 3.9.15 |
| `python-orjson` | openSUSE:Tumbleweed | All versions | 3.11.9-1.4 |
| `python-python-rapidjson` | openSUSE:Tumbleweed | All versions | 1.23-1.4 |

Products: Ijl Orjson.

## How do I fix CVE-2024-27454?

Upgrade orjson to 3.9.15 or later.

## Is CVE-2024-27454 being exploited?

There is no known exploitation of CVE-2024-27454 in the wild and no public exploit code.

## Other vulnerabilities in n/a

- [CVE-2025-67221](https://insights.sbomify.com/CVE-2025-67221/): orjson does not limit recursion for deeply nested JSON documents (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-27454 and fix it if it is affected.

What it is: CVE-2024-27454 is a high-severity denial of service vulnerability in n/a, published on 26 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-27454 in the wild and no public exploit code.

Affected packages and fixed versions:
- orjson (PyPI): affected all versions; fixed in 3.9.15
- orjson (PyPI): affected all versions; fixed in 3.9.15
- orjson (PyPI): affected all versions; fixed in 3.9.15

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-2024-27454/ (Markdown: https://insights.sbomify.com/CVE-2024-27454/index.md)
```

## Sources

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

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