#39463 [BC-Insight] `multiSendWithHeader` and `sendWithHeader` have JSON injection vulnerability
Submitted on Jan 30th 2025 at 17:30:22 UTC by @Pig46940 for Audit Comp | Shardeum: Core III
Report ID: #39463
Report Type: Blockchain/DLT
Report severity: Insight
Target: https://github.com/shardeum/lib-net/tree/bugbounty
Impacts:
Shutdown of greater than 10% or equal to but less than 30% of network processing nodes without brute force actions, but does not shut down the network
Description
Brief/Intro
The multiSendWithHeader and sendWithHeader functions are vulnerable to JSON injection due to a lack of format validation in the Rust component (header_v1.rs). This security gap exposes the system to potential exploitation.
Vulnerability Details
Both multiSendWithHeader and sendWithHeader rely on the AppHeader, which in turn uses the send_with_header function from the Rust component. The function's reliance on manual JSON string formatting within header_v1.rs without proper escaping introduces a significant risk. This oversight can be easily exploited, enabling malicious JSON injection.
Impact Details
This vulnerability allows attackers to manipulate header information, potentially overwriting existing data or injecting arbitrary header values. The ability to modify headers poses a risk to the integrity and security of the system, making this issue urgent to address.
References
For more technical details:
Proof of Concept
Proof of Concept
This vulnerability allows an attacker to demonstrate how JSON injection can overwrite existing header data and inject arbitrary, unintended values.
PoC code
How to run
Installation
Run Server
Create PoC code into lib-net/test as a test_poc.ts
Terminal1 Sending server
Terminal 2 Receiving server
Send header
Send JSON injection data to Terminal2
terminal1 Send data to the terminal2
Output
Not only can it overwrite existing data, but it can also add arbitrary JSON data using escaped string data.
Was this helpful?