CVE-2025-57052
NixOS vulnerability analysis and mitigation

Overview

A critical vulnerability (CVE-2025-57052) has been discovered in the cJSON library, affecting versions 1.5.0 through 1.7.18. The flaw allows remote attackers to bypass array bounds checking and access restricted data through malformed JSON pointer strings containing alphanumeric characters. The vulnerability was disclosed in September 2025 and has received a CVSS score of 9.8 (Critical) (SecurityOnline, NVD).

Technical details

The vulnerability resides in the decode_array_index_from_pointer function within cJSON_Utils.c. The core issue is a logic error in the loop condition that incorrectly checks pointer[0] instead of pointer[position], allowing non-digit characters to be processed as part of the array index. For example, an input like "0A" is interpreted as index 10, even if the array only contains three elements, leading to out-of-bounds memory access (X-0R).

Impact

The vulnerability can lead to multiple severe consequences including out-of-bounds memory access, segmentation faults, privilege escalation, and denial of service. The broad adoption of cJSON in web APIs, embedded/IoT devices, and various desktop and server applications makes this vulnerability particularly impactful. Attackers can potentially crash services, bypass application-level checks, and access sensitive data by reading beyond allocated memory regions (SecurityOnline).

Mitigation and workarounds

The vulnerability can be fixed by correcting the loop condition in the decode_array_index_from_pointer function to properly validate each character position. The patched version should change the condition from 'pointer[0] <= '9'' to 'pointer[position] <= '9''. Users are advised to update to the latest version of cJSON that includes this fix (X-0R).

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-20807MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20806MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20805MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20804MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20803MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management