The setRouter
function in contract StrategyArb
& StrategyOp
has a vulnerability related to repeated token approvals. it does not reset the existing token allowance to zero before setting a new approval for the router. This causes compatibility issues with ERC20 tokens that enforce the requirement to reset allowance to zero before changing it, such as USDT.
Apart from usdt, the previous router approval should be made to zero before setting an new router
If this function is called multiple times with a new router address, the token approval mechanism may fail, making it impossible to update the router or interact with certain tokens.
The setRouter
function does not reset the existing token allowance to zero before approving a new router.
Some tokens such as USDT, include an approval race protection mechanism, requiring the allowance to be set to 0 before calling the approve
function again.
calls to setRouter can fail
manual review
Medium: because the old/previous router has access to all the tokens.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.