Closed code423n4 closed 2 years ago
Agree that using .transfer is now discouraged. I think a difference here as compared to other contests is that the _to address is simply an input to this function call -- so if it reverts they could try again with a EOA and then transfer manually to the contract. Lowering risk and merging with the warden's QA report #283
Lines of code
https://github.com/code-423n4/2022-06-nibbl/blob/8c3dbd6adf350f35c58b31723d42117765644110/contracts/Basket.sol#L80
Vulnerability details
Impact
Basket.withdrawETH
usestransfer
to move Ether,transfer
uses a limited gas stipend which can run out, making it impossible to move the ETH out.From my experience a direct call via Gnosis Safe will still be fine, however a contract that implements any Storage related logic in receive will most likely revert.
Recommended Mitigation Steps
Refactor to the pattern you've already used of
(bool _success, ) = payable(_to).call{value: address(this).balance}(""); require(_success);