You are viewing a single comment's thread from:

RE: Steemd 0.20.6 bug - memory exhaustion when parsing malicious hello_message

in #utopian-io6 years ago (edited)

.

Sort:  

I thought that custom_json ops didn't use the C++ variant type, but just a JSON string. There is a bug in the JSON parser, but not an exploitable one in the way it is used. But I haven't looked at that in detail, it would certainly be good to understand what sort of things somebody could insert using a custom_json operation.

.

Thinking about this a little more, I was worried you might have been right about nested JSON objects, and that deeply-nested JSON objects in the JSON-RPC API could still cause the thread to die because of stack overflow.

The parser does have a check that you can't nest JSON objects or arrays more than 100 deep: https://github.com/steemit/steem/blob/9e83f66c85a2c76bef1a07cef7dd302d2c4be572/libraries/fc/src/io/json.cpp#L442

But I'm not sure it's effective, I can think of one way it might be fooled.

Thank you for your review, @crokkon! Keep up the good work!