Skip to content
Business logic Audit finding Beginner

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.

Anurag Jain Follow

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

  1. 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)
  1. Observe that unpaused(p) modifier is missing
  2. 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.
  3. 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) {
...
}

JTraversa (Swivel) confirmed

robrobbins (Swivel) resolved:

Addressed: https://github.com/Swivel-Finance/gost/pull/420


The original report as published on Code4rena, by csanuragjain. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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

  1. Inspect the authRedeem function definition and note the missing unpaused(p) modifier.
  2. Place the marketplace in a paused state as an admin.
  3. Call authRedeem via withdraw or redeem on the ZcToken contract.
  4. 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.

More by Anurag Jain

View all

63 more disclosed reports, best first.

More from Swivel v3 contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.