ZeroHour

CVE-2026-67217

PoC large

Non-atomic JSON Patch application in cJSON deletes data on failed patches

CVSS 4.0
6.9 medium
EPSS
<1%p22
Published
()
Modified
AI analysis

cJSON through 1.7.19 applies RFC 6902 JSON Patch operations non-atomically in apply_patch() in cJSON_Utils.c: for a replace operation missing its value member, or a move operation whose destination path cannot be resolved, the existing target member is detached and deleted before the operation is fully validated. An attacker who can supply the patch document sends such a malformed operation and destroys addressable members of the target document even though cJSONUtils_ApplyPatches() or cJSONUtils_ApplyPatchesCaseSensitive() returns a failure status. This defeats the all-or-nothing semantics callers rely on to reject bad patches, causing silent data loss and integrity corruption (CWE-696, incorrect behavior order). Any application, SDK, or firmware embedding an affected cJSON release and using the JSON Patch utility functions with attacker-controlled documents is affected; deployments that only use cJSON for parsing are not impacted. No in-the-wild exploitation is known: a public proof-of-concept write-up exists, EPSS is 0.3% (22nd percentile), the issue is not in CISA KEV, and CVSS 4.0 rates it 6.9 medium.

What to do: Audit builds for cJSON versions 1.7.19 or older and check whether any code path calls cJSONUtils_ApplyPatches() or cJSONUtils_ApplyPatchesCaseSensitive() with attacker-supplied patch documents, then upgrade to a cJSON release newer than 1.7.19 once upstream publishes a fix. Until patched, pre-validate patches (reject replace operations lacking a value member and move operations with unresolvable destination paths), or treat any failure return from the patch API as 'document may have been partially modified' rather than assuming atomicity.

Affected
davegamble cjsonall versions through and including 1.7.19 (<= 1.7.19)
Estimated exposure
large≈10,000–100,000 vulnerable applications/devices (cJSON itself is embedded in >1M deployments, but only those calling the RFC 6902 patch API with untrusted… — No public install census exists for the niche cJSONUtils_ApplyPatches code path, so the estimate combines cJSON's ubiquity as a vendored C JSON parser across applications, SDKs and IoT firmware (order of millions of embeds) with the fact…

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 applies RFC 6902 JSON Patch operations non-atomically in apply_patch() in cJSON_Utils.c. For a replace operation that is missing its value member, or a move operation whose destination path cannot be resolved, the existing target member is detached and deleted before the operation is fully validated, so the target document is mutated while cJSONUtils_ApplyPatches() or cJSONUtils_ApplyPatchesCaseSensitive() returns a failure status. An attacker who can supply the patch document can destroy addressable members of the target document even though the API reports that the patch failed, defeating the all-or-nothing behavior callers rely on to reject bad patches.

Vendors
davegamble
Products
cjson
Weakness
CWE-696
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/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.