Submitted by IllIllI, also found by defsec and Dravee
TopUpAction.sol#L50
LiquidityPool.sol#L721
OpenZeppelins safeApprove() will revert if the account already is approved and the new safeApprove() is done with a non-zero value
OpenZeppelin/SafeERC20.sol#L45-L58
Customers can be prevented from register()ing the same token/stakerVaultAddress as another customer; and once changed away from, stakers and lptokens cant be used in the future.
There are multiple places where safeApprove() is called a second time without setting the value to zero first.
register() calls lockFunds() for each user registration, and since users will use the same tokens and staker vaults, the second users register() call will fail:
TopUpAction.sol#L36-L50
The changing of either the staker or an lp token is behind a time-lock, and once the time has passed, the changed variables rely on this function:
LiquidityPool.sol#L717-L722
If a bug is found in a new staker or lpToken and the governor wishes to change back to the old one(s), the governor will have to wait for the time-lock delay only to find out that the old value(s) cause the code to revert.
Ive filed the other more-severe instances as a separate high-severity issue, and flagged the remaining low-severity instances in my QA report.
Always do safeApprove(0) if the allowance is being changed, or use safeIncreaseAllowance().
chase-manning (Backd) confirmed
samwerner (Backd) commented:
chase-manning (Backd) resolved resolved
