Boost _ Shardeum_ Ancillaries 33577 - [Websites and Applications - Insight] Taking down the HTTP server via jayson -day vulnerability
Submitted on Tue Jul 23 2024 19:52:16 GMT-0400 (Atlantic Standard Time) by @anton_quantish for Boost | Shardeum: Ancillaries
Report ID: #33577
Report type: Websites and Applications
Report severity: Insight
Target: https://github.com/shardeum/json-rpc-server/tree/dev
Impacts:
Taking down the application/website
Description
Brief/Intro
After finding https://bugs.immunefi.com/dashboard/submission/33571 I started to play around the same code of your HTTP server which is built on Jayson and, accidentally, found a similar 0-day vulnerability there. It requires just a single request to completely take down the application.
Vulnerability Details
The vulnerability works a very similar way. When you create the Jayson server instance, you pass the methods into constructor:
They are then parsed and stored within server._methods
mapping. When the request is sent to the server, it first resolves the methods the following way:
and then executes it passing the args inside:
As far as I understand, such a call is equivalent to
This way, we can override some server fields using the same __defineGetter__
function. I tried to override the _methods
field itself and completely broke the server (look at PoC).
Impact Details
Complete HTTP server take down.
Proof of concept
Proof of Concept
Start the JSON-RPC server
Send the following request with cURL:
Try to send any valid request, for instance
Make sure the traceback is returned and the same traceback is in server logs:
I think the different impacts are also possible here but I didn't dive deeper. The RCE couldn't be achieved though I think.
Mitigation
Since this is a 0-day vulnerability in the 3rd-party library, I think you have the following options:
report this issue to the vendor and await for the fix to be implemented (I can assist you with that if you want me to);
use some other JSON-RPC server library.
Last updated