Skip to content
DoS Audit finding Intermediate

Redeem Sense can be bricked

The Redeemer contract allows a user to supply an arbitrary Sense market address, and when that address is a malicious contract that does nothing, the Redeemer transfers the lender's principal to itself but never redeems it. This locks the principal and prevents any further redemption of that Sense market.

kenzo Follow

Originally disclosed on Code4rena

Submitted by kenzo

Sense’s redeem can be totally DOSd due to user supplied input.

Impact

Using this attack, Sense market can not be redeemed.

Proof of Concept

This is how Sense market is being redeemed:

        IERC20 token = IERC20(IMarketPlace(marketPlace).markets(u, m, p));
        uint256 amount = token.balanceOf(lender);
        Safe.transferFrom(token, lender, address(this), amount);
        ISense(d).redeem(o, m, amount);

The problem is that d is user supplied input and the function only tries to redeem the amount that was transferred from Lender.

A user can supply malicious d contract which does nothing on redeem(o, m, amount). The user will then call Redeemer’s redeem with his malicious contract. Redeemer will transfer all the prinicipal from Lender to itself, will call d (noop), and finish. Sense market has not been redeemed.

Now if somebody tries to call Sense market’s redeem again, the amount variable will be 0, and Redeemer will try to redeem 0 from Sense.

All the original principal is locked and lost in the contract, like tears in rain.

Recommended Mitigation Steps

I think you should either use a whitelisted Sense address, or send to ISense(d).redeem Redeemer’s whole principal balance.

sourabhmarathe (Illuminate) confirmed


The original report as published on Code4rena, by kenzo. 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 contract trusts a user-supplied market address and only redeems the amount transferred, without verifying that the market is legitimate or that the redemption succeeded.

Impact

The principal is locked and lost, and the Sense market can no longer be redeemed.

What the attacker needed

Ability to call Redeemer's redeem function; a malicious contract implementing redeem as no-op

The fix

The contract should either use a whitelisted Sense address or redeem the Redeemer's entire principal balance instead of only the transferred amount.

How it was found

  1. Deploy a malicious contract that implements the redeem function as a no-op.
  2. Call Redeemer's redeem function with the malicious contract address as the market parameter.
  3. The Redeemer transfers the lender's principal to itself and calls the malicious contract, which does nothing.
  4. The principal remains locked in the Redeemer, and subsequent redemption attempts for the real Sense market fail because the amount is 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.

A smart contract called Redeemer lets users redeem tokens from a market. The user can choose which market contract to call. If they choose a fake market that does nothing, the Redeemer still takes the real tokens from the lender but never redeems them, so the tokens get stuck. After that, the real market cannot be redeemed because the Redeemer thinks there is nothing left to redeem.

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.

More by kenzo

View all

53 more disclosed reports, best first.

More from Illuminate contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.