CVE-2026-16554: Integer Overflow Leading to Heap Buffer Overflow in cJSON
cJSON library is vulnerable to an integer overflow in the printstringptr() function in cJSON.c on 32-bit platforms. The escapecharacters counter, a 32-bit sizet, can wrap around when processing strings containing approximately 858,993,460 or more control characters, causing the output buffer to be allocated based on an underestimated length. When cJSONPrintBuffered() is used with a pre-allocated buffer, the subsequent write loop overflows the heap allocation. An attacker supplying a crafted JSON string to an application using cJSON on a 32-bit platform can cause a heap buffer overflow, potentially leading to remote code execution, information disclosure, or denial of service.
Because project creator contact attempts were unsuccessful, the vulnerability has only been confirmed in version 1.7.19 but may also affect other versions.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-16554?
CVE-2026-16554 has a medium severity rating of 5.1.
How do I fix CVE-2026-16554?
To fix CVE-2026-16554, update the cJSON library to the latest version that addresses this integer overflow vulnerability.
What is the risk associated with CVE-2026-16554?
The risk associated with CVE-2026-16554 is rated at 43, indicating potential severe impacts on affected systems.
What type of vulnerability is CVE-2026-16554?
CVE-2026-16554 is classified as an integer overflow vulnerability that leads to a heap buffer overflow in the cJSON library.
On which platforms does CVE-2026-16554 affect the cJSON library?
CVE-2026-16554 specifically affects the cJSON library on 32-bit platforms.