ZeroHour

CVE-2026-67215

PoC mass

Uncontrolled Recursion DoS in cJSON (through 1.7.19) JSON Patch Handling

CVSS 4.0
8.7 high
EPSS
<1%p39
Published
()
Modified
AI analysis

cJSON through version 1.7.19, DaveGamble's widely embedded open-source C JSON library, is vulnerable to uncontrolled recursion (CWE-674) that causes stack exhaustion and a process crash when an untrusted RFC 6902 JSON Patch document is applied via cJSONUtils_ApplyPatches() or cJSONUtils_ApplyPatchesCaseSensitive(). The flaw arises because add and copy operations in a crafted patch graft duplicated subtrees, driving document depth far beyond the parser's 1000-level nesting limit, while cJSON_Delete() recurses with no depth bound and cJSON_Duplicate()'s CJSON_CIRCULAR_LIMIT guard of 10000 permits trees deep enough to overflow a default thread stack. An attacker who can supply the patch document gains denial of service only: the CVSS 4.0 base of 8.7 (AV:N/AC:L/AT:N/PR:N/UI:N) reflects high availability impact with no confidentiality or integrity loss. Any application, daemon, or embedded product that links or vendors cJSON up to 1.7.19 and applies attacker-controlled JSON Patch documents is affected; the CVE record lists only the davegamble/cjson product itself, so downstream consumers must be identified through dependency auditing. There is no confirmed in-the-wild exploitation (absent from CISA KEV, EPSS about 0.5%), but one public analysis with a proof-of-concept is available.

What to do: Audit dependencies and vendored source trees for cJSON (forked copies are common given its single-file MIT distribution) and determine whether cJSONUtils_ApplyPatches()/cJSONUtils_ApplyPatchesCaseSensitive() ever processes untrusted input; no fixed release is stated in the available data, so track the upstream DaveGamble/cJSON repository for a patched version beyond 1.7.19 and upgrade when one is published. As an interim mitigation, cap patch document depth and operation counts well below the parser's 1000-level nesting limit before applying patches, and/or run JSON Patch processing in an isolated worker process so a stack-overflow crash does not take down the host service.

Affected
DaveGamble (davegamble) cJSONall versions through and including 1.7.19
Estimated exposure
massOn the order of millions of devices and application builds embed cJSON (widely vendored/bundled C library), though the subset with the JSON Patch path exposed… — Estimate based on cJSON's deployment pattern as one of the most widely vendored C JSON libraries - its MIT-licensed source is copied into thousands of projects and bundled in major embedded SDK distributions - implying a multi-million…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

cJSON through 1.7.19 is vulnerable to uncontrolled recursion leading to stack exhaustion when an untrusted RFC 6902 JSON Patch is applied via cJSONUtils_ApplyPatches() or cJSONUtils_ApplyPatchesCaseSensitive(). A patch containing add and copy operations grafts duplicated subtrees to amplify document depth beyond the parser's nesting limit: cJSON_Delete() recurses with no depth bound, and the cJSON_Duplicate() guard CJSON_CIRCULAR_LIMIT is set to 10000, ten times the parser's 1000-level nesting limit and high enough to overflow a default thread stack. An attacker who can supply the patch document can crash the process, resulting in denial of service.

Vendors
davegamble
Products
cjson
Weakness
CWE-674
Vector
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:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news

No ingested article mentions this CVE yet.