CVE-2026-87933: cJSON use-after-free in MergePatch

CVE-2026-87933 · Severity: high · CVSS 7.3 · Published 2026-09-10

cJSON is a lightweight JSON parsing library used in many C/C++ applications. A use-after-free vulnerability exists in the MergePatch function, which is used to merge JSON objects. An attacker who can control JSON input to an application using this library could cause a crash or potentially execute arbitrary code by triggering memory corruption.

Technologies: DaveGamble cJSON. Vendors: DaveGamble.

Quick answers

Is CVE-2026-87933 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-87933 being exploited in the wild.
How severe is CVE-2026-87933?
High severity, with a CVSS score of 7.3, published 10 September 2026.
Which products and versions are affected?
DaveGamble cJSON up to 1.7.19.
Is there a fix for CVE-2026-87933?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2026-87933 attacked?
It is attacked over the network.
Am I affected by CVE-2026-87933?
Check whether you run DaveGamble cJSON at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A heap use-after-free (UAF) exists in cJSON's RFC 7386 MergePatch implementation within the merge_patch() function in cJSON_Utils.c. When cJSONUtils_MergePatch() is called with a non-object patch (e.g., an array or scalar), the function frees the target object at line 1328, then immediately calls cJSON_Duplicate(patch, 1). The cJSON_Duplicate_rec() function dereferences the freed memory when reading item->type from the already-freed object, causing a use-after-free condition. The vulnerability requires the attacker to supply malformed JSON input to an application that uses the MergePatch API. A fix is available via pull request: duplicate the patch before freeing the target, or null-check before freeing.

Affected products

  • DaveGamble cJSON up to 1.7.19

Timeline

  • 2026-09-10: disclosed
  • other: Exploit made public; fix awaits pull request acceptance

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.