open-source-parsers / open-source-parsers/jsoncpp
Denial-of-service from uncontrolled deep recursion in OurReader::readValue (exceed stackLimit)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.9k
- Forks
- 2.7k
- Avg merge
- 31m
- Merged PRs (30d)
- 1
Description
Describe the bug
A denial-of-service vulnerability in jsoncpp 1.9.6. When OurReader::readValue() parses a deeply nested JSON array, recursive calls between readValue() and readArray() exceed the default stackLimit (1000) and throw an uncaught Json::RuntimeError, causing std::terminate() and process exit.
The crash occurs at json_reader.cpp:1041:5 in Json::OurReader::readValue(), triggered by a crafted input containing approximately 1100 consecutive [ characters.
All complete vulnerability resources, including vulnerability description, fuzzer binary, PoC payload and reproduction steps, are stored in my research repository:
https://github.com/eglonnnn/opensource-fuzz-vulnerability-research/tree/main/jsoncpp-deep-nested-array-recursion-dos
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at json_reader.cpp:1041 in Json::OurReader::readValue() and trace its recursive interaction with readArray() around the stackLimit check. Reproduce the failure with approximately 1100 nested '[' characters using the linked reproduction resources, then verify that malformed or deeply nested input no longer causes an uncaught Json::RuntimeError or process termination.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100