code-423n4 / 2021-12-amun-findings

0 stars 0 forks source link

ETH that is accidentally sent to a receive() function cannot be withdrawn #253

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

GiveMeTestEther

Vulnerability details

Impact

Every ETH that wasn't received by "receive() external payable" from "INTERMEDIATE_TOKEN" by calling "withdraw()" cannot be withdrawn. Because in the contract we only transfer INTERMEDIATE_TOKEN.balanceOf(address(this)) and not the ETH balance of the contract, that also could be sent accidentally.

Proof of Concept

2021-12-amun\contracts\basket\contracts\singleJoinExit\EthSingleTokenJoin.sol: receive() external payable {} 2021-12-amun\contracts\basket\contracts\singleJoinExit\EthSingleTokenJoinV2.sol: receive() external payable {} 2021-12-amun\contracts\basket\contracts\singleJoinExit\SingleNativeTokenExit.sol: receive() external payable {} 2021-12-amun\contracts\basket\contracts\singleJoinExit\SingleNativeTokenExitV2.sol: receive() external payable {}

Tools Used

Manual Analysis

Recommended Mitigation Steps