ETH Dust Accumulation in createAndInitializePoolIfNecessary
#128
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
🤖_24_group
AI based duplicate group recommendation
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/periphery/base/PoolInitializer.sol#L15-L35
Vulnerability details
Impact
The
createAndInitializePoolIfNecessary
function in the PoolInitializer contract is marked as payable, but does not include logic for handling any ETH sent with the transaction. This oversight could result in unintended "dust" ETH becoming trapped in the contract indefinitely. Over time, this could lead to the following impacts:Proof of Concept
In the
PoolInitializer
contract:createAndInitializePoolIfNecessary
is markedpayable
, allowing it to receive ETH.Potential Issues:
Tools Used
Manual code review.
Recommended Mitigation Steps
Add a mechanism to refund any unused ETH at the end of the function. For instance, implementing a call to the
refundETH()
function from thePeripheryPayments
contract, if available, would prevent ETH from being trapped in the contract and ensure user funds are safely returned. Alternatively, adding anaddress(0).call{value: msg.value}("");
call would return any attached ETH back to the sender if unutilized.Assessed type
Payable
The text was updated successfully, but these errors were encountered: