Closed Du4t closed 11 months ago
This appears to have CVE-2023-50471 assigned.
Hi @Du4t It will be appreciated if you can provide a POC.
Currently I tested with newitem->prev
as NULL but I can not reproduce this problem.
Besides this, I don't think it's a good practice to request a CVE without this problem being confirmed.
The only way I can reproduce this problem is to pass a corrupted array
to cJSON_InsertItemInArray
like this:
cJSON *item = cJSON_CreateString("item");
cJSON *array = cJSON_CreateArray();
cJSON *temp1 = cJSON_CreateString("item1");
cJSON *temp2 = cJSON_CreateString("item2");
add_item_to_array(array, temp1);
add_item_to_array(array, temp2);
// manually set the prev to be NULL to make a corrupted array
temp2->prev = NULL;
// SEGV as after_inserted->prev is NULL, which is passed to newitem->prev, making newitem->prev->next a NULL pointer using
cJSON_InsertItemInArray(array, 1, item);
Is this the correct way to reproduce this problem?
Hi,
Is there any plan to backport the fix to 1.7.16 version.
Description
If the the newitem passed in cJSON_InsertItemInArray dont have
prev
, thenewitem->prev
will be null. The null pointer dereference will cause SEGV in function cJSON_InsertItemInArray cJSON.c:2287Version
Related Code
Impact
Potentially causing DoS