exitTempusAMM can be made to fail
The exitTempusAMM function contains an assert that the contract's LP token balance is zero after redemption, but an attacker can front-run by sending a tiny amount of LP tokens to the contract, causing the assert to fail and blocking all legitimate exits.
Submitted by cmichel.
There’s a griefing attack where an attacker can make any user transaction for TempusController.exitTempusAMM fail. In _exitTempusAMM, the user exits their LP position and claims back yield and principal shares. The LP amounts to redeem are determined by the function parameter lpTokensAmount. A final assert(tempusAMM.balanceOf(address(this)) == 0) statement checks that the LP token amount of the contract is zero after the exit. This is only true if no other LP shares were already in the contract.
However, an attacker can frontrun this call and send the smallest unit of LP shares to the contract which then makes the original deposit-and-fix transaction fail.
Impact
All exitTempusAMM calls can be made to fail and this function becomes unusable.
Recommended Mitigation Steps
Remove the assert check.
Great finding. This can block people exiting AMM via
TempusController.
Fixed in https://github.com/tempus-finance/tempus-protocol/pull/369
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
Root cause
The assert assumes the contract's LP token balance is zero after redemption, but an attacker can donate LP tokens to break this assumption.
Impact
All exitTempusAMM calls can be made to fail, making the function unusable.
What the attacker needed
Attacker can front-run transactions; attacker has a tiny amount of LP tokens
The fix
The assert check was removed, as confirmed by the Tempus team.
How it was found
- Attacker front-runs a user's exitTempusAMM transaction.
- Attacker sends the smallest unit of LP shares to the TempusController contract.
- The user's transaction executes and the assert fails because the contract's LP balance is not zero.
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 griefing attack where someone prevents others from using a function. The function checks that the contract has no LP tokens left after a user exits, but an attacker can send a tiny amount of LP tokens to the contract first, so the check always fails and no one can exit.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.