unpaused(p) modifier missing in authRedeem function
The authRedeem function in a smart contract lacks the unpaused(p) modifier, so users can redeem zcTokens and withdraw underlying assets even when the market is paused. An attacker could bypass the admin's pause to withdraw funds during a paused state.
Originally disclosed on Code4rena
Submitted by csanuragjain, also found by cccz
Due to missing modifier, User will be able to redeem zcTokens and withdraw underlying even in paused Market. This happens due to missing unpaused(p) modifier
Proof of Concept
- Lets see function definition for authRedeem function
function authRedeem(uint8 p, address u, uint256 m, address f, address t, uint256 a) public authorized(markets[p][u][m].zcToken) returns (uint256 underlyingAmount)
- Observe that unpaused(p) modifier is missing
- This means if Marketplace is placed under paused state by Admin, then also User can call authRedeem at Marketplace via withdraw/redeem at ZcToken contract.
- This will allow Users to withdraw in paused state which is incorrect
Recommended Mitigation Steps
Add unpaused(p) modifier in authRedeem function
function authRedeem(uint8 p, address u, uint256 m, address f, address t, uint256 a) public authorized(markets[p][u][m].zcToken) unpaused(p) returns (uint256 underlyingAmount) {
...
}
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 authRedeem function lacks the unpaused(p) modifier that is present on other functions to enforce the market pause.
Impact
Users could withdraw funds from a paused market, bypassing the admin's emergency pause control.
What the attacker needed
Market is paused by admin; user has zcTokens to redeem
The fix
The missing unpaused(p) modifier was added to the authRedeem function.
How it was found
- Inspect the authRedeem function definition and note the missing unpaused(p) modifier.
- Place the marketplace in a paused state as an admin.
- Call authRedeem via withdraw or redeem on the ZcToken contract.
- Observe that the withdrawal succeeds despite the pause.
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 smart contract has a pause feature to stop certain actions in an emergency. The function that lets users redeem tokens and withdraw funds was missing the check that enforces the pause, so users could still withdraw even when the market was paused.
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.