Unvalidated msg.value
in AggregateRouter::execute()
Allows Unauthorized WRAP_ETH
and UNWRAP_WETH
Operations, Potentially Leading to Contract Fund Drain
#208
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
🤖_50_group
AI based duplicate group recommendation
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/ronin-chain/katana-operation-contracts/blob/27f9d28e00958bf3494fa405a8a5acdcd5ecdc5d/src/aggregate-router/AggregateRouter.sol#L37
https://github.com/ronin-chain/katana-operation-contracts/blob/27f9d28e00958bf3494fa405a8a5acdcd5ecdc5d/src/aggregate-router/base/Dispatcher.sol#L164-L180
Vulnerability details
Summary
A vulnerability exists in the
AggregateRouter::execute()
function when handling theCommands.WRAP_ETH command
on the Dipacther.sol. This vulnerability allows an attacker to attempt wrapping Ether without sending the corresponding amount of Ether (msg.value), potentially leading to unexpected behavior or financial loss.Vulnerability Details
The dispatch function within the Dispatcher contract, specifically when processing the Commands.WRAP_ETH command.
The attacker prepares the
WRAP_ETH command
with a fake amount.The attacker can call the execute function without sending the required Ether (
msg.value
). Since thedispatch
function does not validatemsg.value
, thewrapETH
function could be executed with an incorrect amount, potentially leading to unintended WETH transfers. A similar issue exists with theUNWRAP_WETH
command, which could lead to the contract's funds being completely drained.Impact
this could lead to incorrect Ether wrapping, resulting in financial discrepancies or loss.
Tools Used
Manual Review
Recommendations
Add a check to ensure that the amount to be wrapped does not exceed
msg.value
.Use msg.value directly if applicable, to ensure consistency.
Assessed type
ETH-Transfer
The text was updated successfully, but these errors were encountered: