How a Missing Type Check Turned Into a Remote Node Crash ($100 Bo
A peer-to-peer node accepted a JSON message where a field expected to be a string was an array, and this unvalidated value reached a SQL query, causing a syntax error and an uncaught exception that terminated the node process. Any connected peer could send this malformed message to crash the node, creating a remote denial of service.
Published on medium.com
I’m Sumit Shah, a cybersecurity researcher and bug bounty hunter from India. In this write-up, I’m sharing a vulnerability I recently discovered that shows how a single unchecked assumption can crash an entire node.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The network boundary did not enforce that a nested field was a string before passing it to a database query, and the resulting database error was not caught.
Impact
Any connected peer could crash the node without authentication, causing a remote denial of service that affects availability.
What the attacker needed
Ability to connect as a peer
The fix
The fix was to add a type check at the boundary that rejects the message if the field is not a string, preventing it from reaching the database.
How it was found
- Connect to the node as a peer over WebSocket.
- Send a JSON message of the joint type where the unit field is an array instead of a string.
- The node processes the message, reaches the database layer, and the malformed value causes a SQL syntax error.
- The unhandled exception terminates the node process.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A node is a computer running the blockchain software that talks to other nodes. The software assumed a certain piece of incoming data would always be text, but an attacker sent a list instead. That unexpected type confused the database query and crashed the whole program, so anyone connected could knock the node offline.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.