Closed code423n4 closed 2 years ago
https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/staking/InfinityStaker.sol#L346
The rescue ETH function sends to the sender msg.value instead of address(this).balance.
msg.value
address(this).balance
Wrong implementation, ETH can't be rescued from the contract.
This is rescueETH function:
rescueETH
function rescueETH(address destination) external payable onlyOwner { (bool sent, ) = destination.call{value: msg.value}(''); require(sent, 'Failed to send Ether'); }
Send the contract's balance instead of msg.value.
https://github.com/code-423n4/2022-06-infinity-findings/issues/11
Dupe https://github.com/code-423n4/2022-06-infinity-findings/issues/296
Lines of code
https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/staking/InfinityStaker.sol#L346
Vulnerability details
The rescue ETH function sends to the sender
msg.value
instead ofaddress(this).balance
.Impact
Wrong implementation, ETH can't be rescued from the contract.
Proof of Concept
This is
rescueETH
function:Recommended Mitigation Steps
Send the contract's balance instead of msg.value.