Open code423n4 opened 3 years ago
ATokenYieldSource PR: https://github.com/pooltogether/aave-yield-source/pull/19
BadgerYieldSource PR: https://github.com/pooltogether/badger-yield-source/pull/6
SushiYieldSource PR: https://github.com/pooltogether/sushi-pooltogether/pull/16
ControlledToken PR: https://github.com/pooltogether/pooltogether-pool-contracts/pull/306
StakePrizePool PR: https://github.com/pooltogether/pooltogether-pool-contracts/pull/314
@asselstine I'm not sure we want to check for non zero address in the PrizePool withdrawReserve
function since this function is only callable by the Reserve and the owner of the Reserve contract.
https://github.com/pooltogether/pooltogether-pool-contracts/blob/192429c808ad9714e9e05821386eb926150a009f/contracts/reserve/Reserve.sol#L32
https://github.com/pooltogether/pooltogether-pool-contracts/blob/4449bb2e4216511b7187b1ab420118c30af39eb7/contracts/prize-pool/PrizePool.sol#L473
Yeah @PierrickGT I don't think the withdrawReserve
needs to do the check. Many tokens reject on transfer to zero anyway.
LGTM
Handle
cmichel
Vulnerability details
Some parameters of functions are not checked for invalid values:
StakePrizePool.initialize
:address _stakeToken
not checked for non-zero or contractControlledToken.initialize
:address controller
not checked for non-zero or contractPrizePool.withdrawReserve
:address to
not checked for non-zero, funds will be lost when sending to zero addressATokenYieldSource.initialize
:address _aToken, _lendingPoolAddressesProviderRegistry
not checked for non-zero or contractBadgerYieldSource.initialize
:address badgerSettAddr, badgerAddr
not checked for non-zero or contractSushiYieldSource.constructor
:address _sushiBar, _sushiAddr
not checked for non-zero or contractImpact
Wrong user input or wallets defaulting to the zero addresses for a missing input can lead to the contract needing to redeploy or wasted gas.
Recommended Mitigation Steps
Validate the parameters.