Open code423n4 opened 2 years ago
dmvt marked the issue as duplicate of #60
dmvt marked the issue as satisfactory
dmvt marked the issue as selected for report
JeeberC4 marked the issue as not a duplicate
JeeberC4 marked the issue as primary issue
Lines of code
https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/liquid-staking/GiantLP.sol#L39-L47 https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/liquid-staking/GiantMevAndFeesPool.sol#L73-L78 https://github.com/code-423n4/2022-11-stakehouse/blob/main/contracts/liquid-staking/SyndicateRewardsProcessor.sol#L51-L57
Vulnerability details
Impact
The GiantLP with a transferHookProcessor will call
transferHookProcessor.beforeTokenTransfer(_from, _to, _amount)
when it's transferred / minted / burned.But the
to
address is address(0x00) in the erc20_burn
function. The GiantMevAndFeesPool.beforeTokenTransfer will call the functionSyndicateRewardsProcessor._distributeETHRewardsToUserForToken
will a zero address check in the first line:So any withdraw function with a operation of burning the GiantLP token with a transferHookProcessor will revert because of the zero address check. The users' funds will be stuck in the Giant Pool contracts.
Proof of Concept
I wrote a test about
GiantMevAndFeesPool.withdrawETH
function which is used to withdraw eth from the Giant Pool. It will be reverted.test/foundry/LpBurn.t.sol
run test
test log:
Tools Used
foundry
Recommended Mitigation Steps
skip update rewards for zero address.