NULL Pointer Dereference Affecting davegamble/cjson package, versions [,1.7.18)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.04% (12th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about NULL Pointer Dereference vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-UNMANAGED-DAVEGAMBLECJSON-6674149
  • published26 Apr 2024
  • disclosed26 Apr 2024
  • creditLuo Jin

Introduced: 26 Apr 2024

CVE-2024-31755  (opens in a new tab)
CWE-476  (opens in a new tab)

How to fix?

Upgrade davegamble/cjson to version 1.7.18 or higher.

Overview

Affected versions of this package are vulnerable to NULL Pointer Dereference due to a segmentation violation that can be triggered through the second parameter of function cJSON_SetValuestring at cJSON.c. An attacker can cause a denial of service or potentially execute arbitrary code by supplying a specially crafted input to the affected function.

PoC

cJSON *item = cJSON_CreateString("apple");
cJSON_SetValuestring(item, NULL);

CVSS Scores

version 3.1