Inability to withdraw funds for certain users due to whenNotPaused modifier in RateLimitedMinter
When the protocol is paused, the RateLimitedMinter's mint function is blocked by a whenNotPaused modifier, and because unstaking first tries to mint pending guild rewards, users with staked CREDIT and pending rewards cannot unstake or withdraw. This contradicts the documented expectation that the GUARDIAN role can freeze usage but not block withdrawals.
Submitted by EV_om, also found by Takarez
From the audit documentation:
[The GUARDIAN role] is expected to be able to freeze new usage of the protocol, but not prevent users from withdrawing their funds.
However, due to the whenNotPaused modifier in the RateLimitedMinter.mint() function, users who have CREDIT tokens staked on a gauge with a pending guildReward will not be able to withdraw their funds. This is because the SurplusGuildMinter.unstake() function attempts to mint rewards through the RateLimitedMinter in the getRewards() function prior to unstaking. If the protocol is paused, this step will fail, causing the transaction to revert and preventing users from withdrawing their funds.
Proof of Concept
Consider a scenario where Alice has CREDIT tokens staked on a gauge with a pending guildReward. Then, the protocol is paused and Alice attempts to unstake her tokens by calling the SurplusGuildMinter.unstake() function, which in turn calls the getRewards() function. This function attempts to mint rewards through the RateLimitedMinter.mint() function. However, because the protocol is paused, this function cannot be executed, causing the transaction to revert and preventing Alice from unstaking and withdrawing her funds.
Recommended Mitigation Steps
Provide an emergencyWithdraw method allowing users to withdraw their funds while foregoing rewards when the protocol is paused. This change should be carefully reviewed and tested to ensure it does not introduce other security risks.
eswak (Ethereum Credit Guild) confirmed and commented:
Very nice catch, thanks a lot for reporting!
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
Likely the unstake path performs a reward mint through a pausable minter before releasing the user's stake, so pausing blocks the entire withdrawal.
What the attacker needed
Staked CREDIT with pending reward; protocol is paused
The fix
An emergency withdraw method should be added so users can retrieve funds while forgoing rewards during a pause.
How it was found
- Alice stakes CREDIT on a gauge and has a pending guild reward.
- The protocol is paused.
- Alice calls the unstake function, which calls getRewards and then tries to mint through the rate-limited minter.
- The mint reverts because of the pause, so the whole unstake transaction reverts.
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.
A pause switch is meant to stop new activity, not to trap people's money. Here, the code that pays out staking rewards runs before the code that returns the staked tokens, and the pause blocks the reward payment, so the whole withdrawal fails. The result is that a safety switch can lock some users out of their own funds.
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.