Closed c4-bot-3 closed 10 months ago
From my understanding, MoneyMarketHook would be deployed as a proxy that can receive ETH -TransparentUpgradeableProxyReceiveETH
, see deploy script:
https://github.com/code-423n4/2023-12-initcapital/blob/main/script/DeployBase.sol#L236
Looks invalid. Will keep it for the sponsor's confirmation.
hansfriese marked the issue as primary issue
fez-init (sponsor) disputed
We are using a modified version of transparent proxy that adds the receive
functionality in the proxy level.
that's right
agree with sponsor
hansfriese marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-12-initcapital/blob/a53e401529451b208095b3af11862984d0b32177/contracts/hook/MoneyMarketHook.sol#L77
Vulnerability details
Impact
MoneyMarketHook.sol is not capable of handling and receive WETH in function execute when WETH is unwrapped to ETH
Proof of Concept
In the last step of function execute
the expect flow is the WETH is transfered to MoneyMarketHook.sol
then the WETH is converted to native ETH via
then the ETH will be transfered to recipient address
However, in this line of code
the MoneyMarketHook.sol has to be able receive the ETH
https://etherscan.io/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2#code#L45
but because the MoneyMarketHook.sol by default does not implementation payable receiver
the withdraw will revert
Tools Used
Manual Review
Recommended Mitigation Steps
add default payable receiver in MoneyMarketHook.sol to make sure the MoneyMarketHook.sol can receive ETH if the user intends to receive ETH
Assessed type
ETH-Transfer