Skip to content

Fix NULL pointer dereference vulnerability in cJSON_InsertItemInArray (CVE-2023-50471) #21086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yannaingtun
Copy link

Description:
This PR adds NULL checks for the array and newitem parameters in the cJSON_InsertItemInArray function to prevent NULL pointer dereferences. This addresses the same vulnerability as CVE-2023-50471 which was fixed in the original cJSON repository.

References:
Original fix: DaveGamble/cJSON@60ff122
CVE-2023-50471: https://nvd.nist.gov/vuln/detail/CVE-2023-50471

@wing328
Copy link
Member

wing328 commented Apr 14, 2025

please update the samples (pr checklist step 3)

cc @zhemant (2018/11) @ityuhui (2019/12) @michelealbano (2020/03) @eafer (2024/12)

@wing328 wing328 added this to the 7.13.0 milestone Apr 14, 2025
@eafer
Copy link
Contributor

eafer commented Apr 14, 2025

I think we should probably update cJSON as a whole. There was some discussion of this matter before: #20431.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants