CVE-2026-16554 Details
Description
cJSON library is vulnerable to an integer overflow in the print_string_ptr() function in cJSON.c on 32-bit platforms. The escape_characters counter, a 32-bit size_t, 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 cJSON_PrintBuffered() 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.
A heap buffer overflow vulnerability has been identified in the cJSON library, specifically in version 1.7.19, within the print_string_ptr() function in cJSON.c. This vulnerability arises on 32-bit platforms due to an integer overflow in the escape_characters counter, which is a 32-bit size_t. The overflow occurs when processing strings with approximately 858,993,460 or more control characters, leading to an underestimated length for the output buffer allocation. When cJSON_PrintBuffered() is used with a pre-allocated buffer, the resulting write loop can overflow the heap allocation. An attacker can exploit this vulnerability by supplying a crafted JSON string to an application that uses cJSON on a 32-bit platform, potentially causing a heap buffer overflow that could be exploited for remote code execution, information disclosure, or denial of service.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jul 27, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| http://www.openwall.com/lists/oss-security/2026/07/30/26 | CVE | Issue TrackingMailing ListThird Party Advisory |
| http://www.openwall.com/lists/oss-security/2026/07/31/4 | CVE | Mailing ListThird Party Advisory |
| https://cert.pl/en/posts/2026/07/CVE-2026-16554 | [email protected] | Third Party Advisory |
| https://github.com/DaveGamble/cJSON | [email protected] | Product |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-190 | Integer Overflow or Wraparound | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| davegamble cjson | 1.7.19 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Aug 26, 2026 | Initial Analysis | [email protected] |
| Jul 31, 2026 | CVE Modified | CVE |
| Jul 30, 2026 | CVE Modified | CVE |
| Jul 27, 2026 | CVE Modified | CISA-ADP |
| Jul 27, 2026 | New CVE Received | [email protected] |