-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Parsing nesting objects in JSON results in segment fault #3539
Comments
This is a submission to EOS bug bounty program and the bug credits to: Yuki Chen of Qihoo 360 Vulcan Team |
I've reproduced it, looks like it's a stack overflow bug:
|
Just FYI this is an old bug which has been reported to EOS team one month before. Also commented here a5f1a20#commitcomment-29160834 Related fix in BitShares:
If there is a bounty for this, it should belong to BitShares Dev Team. |
check_string_depth implementation is naive, best approach is to check object tree depth while parsing. |
@abitmore thanks for bringing this to our attention, you are correct, we did receive a report of this issue from the BitShares Dev team about a month ago, but we failed to act then and lost track of it (we didn't create a GitHub issue 🤦♂️) so the vulnerability was still in our code when 360.cn brought it to our attention therefore they are eligible for the bounty. I understand this may be frustrating for the BitShares Dev team. Please do continue to report vulnerabilities to us and you are welcome to do so via the https://hackerone.com/eosio bug bounty program. |
@gleehokie I think both deserves the bounty, Specially knowing that the bitshares-dev team report the problem without having any financial benefit. Also 360 received a huge backslash for reporting other problem, I think giving the bounty to both parties would be a responsable community oriented approach that would encourage more contributions. |
Hi,
There is a stack overflow bug in json parser when parsing nesting objects.
There is a function named check_string_depth to handle such situation, it tries to make sure the nesting objects' depth is less than 100.
However the check is vulnerable and we can bypass it.
How to test:
1.Start nodeos
2.Execute:
python post.py
to send malicious json rpc request.
3.Observe the crash
The text was updated successfully, but these errors were encountered: