No way to set CURVE_POOL approval after setting new curve pool address
The Staking contract allows the owner to change the CURVE_POOL address, but token approvals are only set in the constructor, so the new pool cannot spend tokens. All calls to exchange() on the new pool will fail.
Submitted by 0xDjango, also found by BowTiedWardens, cccz, hansfriese, Metatron, shung, ych18, and zzzitron
Staking.setCurvePool() allows the owner to set a new CURVE_POOL address, however, there is no way to set token approvals to the new address. The only calls to token.approve() are found in the constructor. Therefore, there’s no true way to set a new curve pool. All calls to ICurvePool(CURVE_POOL).exchange() will fail.
Recommended Mitigation Steps
Set approvals for the new curve pool address in the same setCurvePool() function.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
After the owner sets a new curve pool, all calls to exchange() will fail, making the new pool unusable.
What the attacker needed
Owner calls setCurvePool()
The fix
Set approvals for the new curve pool address inside the setCurvePool() function.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This is a smart contract bug. The contract lets the owner point to a new Curve pool, but it never gives that new pool permission to move the contract's tokens. Without that permission, any attempt to trade via the new pool will be rejected.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.