-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
java.lang.StackOverflowError in org.json.JSONTokener.nextValue::JSONTokener.java:431
json-java 20210307
#654
Comments
Please include any POC code in the issue and not as a separate download. |
Also, do not send in zip files. Send uncompressed files only |
@johnjaylward The test program is as follows:
The poc file is in binary so I cannot just simply paste it here. |
Sorry, I'm not interested in downloading random binary files. If you can make a simple test input as a text file, that would be best. |
Closed due to lack of response. |
Hi @stleary, I'm the collaborator of @ZanderHuang. Sorry for the late reply. Here is the POC code which makes the test input as a base64 text. Can you reopen this issue? Thank you!
|
Thank you for the test input. I'll take a look at this. |
Re-opened |
Hi @johnjaylward , are you willing to help us to request a CVE ID through GitHub Security Advisories for this bug, which can cause Denial of Service. You can follow this tutorial to use it to manage your bug fixes and alert any downstream dependencies of the issue so they can patch immediately if using the broken release. Thanks for your help! |
Wrap StackOverflow with JSONException to fix Issue #654
Xray found a vulnerability on json and was fixed on version 20220320. Please refer to the following links: stleary/JSON-java#654 stleary/JSON-java#660 The new validator library depends on the fixed org.json version: https://github.com/everit-org/json-schema/releases/tag/1.14.1 Source: slack: https://hazelcast.slack.com/archives/G01LH0K3VK8/p1648714007131469
Addresses CVE Refs: stleary/JSON-java#654
java.lang.StackOverflowError in
org.json.JSONTokener.nextValue::JSONTokener.java:431
json-java 20210307This vulnerability is of java.lang.StackOverflowError, and can be triggered in latest version json-java (20210307).
It is caused by triggering infinite recursive function calls under crafted user input file and can be used for attackers to launch DoS (Denial of Service) attack to exhaust the system resources for any java program that uses this library (CWE-121: Stack-based Buffer Overflow).
Likely, the root cause of this crash is in
org.json.JSONTokener.nextValue::JSONTokener.java:431
.See more detail from the following crash stack.
Crash stack:
The crash thread's stack is as follows:
Steps to reproduce:
(poc file and report can be downloaded from https://drive.google.com/drive/folders/1J3HBq-qGi1YxfwVTCS9y5rgelqgkhUQB?usp=sharing)
e.g. :
Any further discussion for this vulnerability including fix is welcomed!
Feel free to contact us at:
Huang Wenjie
Zhang Cen
Zhang Xiaohan
The text was updated successfully, but these errors were encountered: