CVE-2026-67216: Inefficient Algorithmic Complexity in DaveGamble cJSON
cJSON through 1.7.19 contains an inefficient algorithmic complexity flaw in cJSON_Compare(). When comparing objects, the function recurses into each shared subtree twice, once in each direction, with no depth guard, making the running time exponential in nesting depth. A small, deeply nested document of a few hundred bytes (depth around 40) compared for equality consumes hours of CPU, and the cost roughly doubles with each additional level of nesting. An application that calls cJSON_Compare() on attacker-influenced JSON that is structurally equal to a reference document is exposed to a denial-of-service condition.
AI Analysis
Technical Summary
The vulnerability in cJSON up to version 1.7.19 is due to inefficient algorithmic complexity in the cJSON_Compare() function. When comparing JSON objects, the function recursively processes each shared subtree twice, once in each direction, without limiting recursion depth. This behavior causes the running time to grow exponentially with the nesting depth of the JSON document. As a result, even small JSON documents with deep nesting (around 40 levels) can cause the comparison to take hours of CPU time. An attacker can exploit this by providing crafted JSON data that is structurally equal to a reference document, triggering a denial-of-service condition through excessive CPU consumption.
Potential Impact
Applications using vulnerable versions of cJSON that call cJSON_Compare() on attacker-controlled JSON data may experience denial-of-service due to excessive CPU usage. The exponential time complexity can severely degrade performance, potentially making the application unresponsive or causing resource exhaustion.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid calling cJSON_Compare() on untrusted or attacker-influenced JSON data with deep nesting. Consider implementing application-level limits on JSON nesting depth or using alternative JSON comparison methods that do not exhibit this inefficiency.
CVE-2026-67216: Inefficient Algorithmic Complexity in DaveGamble cJSON
Description
cJSON through 1.7.19 contains an inefficient algorithmic complexity flaw in cJSON_Compare(). When comparing objects, the function recurses into each shared subtree twice, once in each direction, with no depth guard, making the running time exponential in nesting depth. A small, deeply nested document of a few hundred bytes (depth around 40) compared for equality consumes hours of CPU, and the cost roughly doubles with each additional level of nesting. An application that calls cJSON_Compare() on attacker-influenced JSON that is structurally equal to a reference document is exposed to a denial-of-service condition.
CVSS v4.0
Score 8.2high
Affected software
DaveGamble
cJSON
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in cJSON up to version 1.7.19 is due to inefficient algorithmic complexity in the cJSON_Compare() function. When comparing JSON objects, the function recursively processes each shared subtree twice, once in each direction, without limiting recursion depth. This behavior causes the running time to grow exponentially with the nesting depth of the JSON document. As a result, even small JSON documents with deep nesting (around 40 levels) can cause the comparison to take hours of CPU time. An attacker can exploit this by providing crafted JSON data that is structurally equal to a reference document, triggering a denial-of-service condition through excessive CPU consumption.
Potential Impact
Applications using vulnerable versions of cJSON that call cJSON_Compare() on attacker-controlled JSON data may experience denial-of-service due to excessive CPU usage. The exponential time complexity can severely degrade performance, potentially making the application unresponsive or causing resource exhaustion.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid calling cJSON_Compare() on untrusted or attacker-influenced JSON data with deep nesting. Consider implementing application-level limits on JSON nesting depth or using alternative JSON comparison methods that do not exhibit this inefficiency.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-07-28T19:20:19.157Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a6a093d9c2644c7f89a31ca
Added to database: 07/29/2026, 14:07:57 UTC
Last enriched: 08/05/2026, 14:40:18 UTC
Last updated: 09/12/2026, 10:01:32 UTC
Views: 88
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.