Baited by redemption during undercollateralization (no issuance, just transfer)
A user redeeming rTokens can receive far less than expected if an attacker manipulates transaction ordering so the redemption occurs while the protocol is undercollateralised and only a tiny amount of backup collateral has been added. The attacker can cause the victim to lose most of the value of their redemption.
Submitted by Cyfrin
This is similar to the “high” vulnerability I submitted, but also shows a similar exploit can be done if a user isn’t a whale, and isn’t issuing anything.
A user can send a redeem TX and an evil actor can make it so they get almost nothing back during recollateralization. This requires ordering transactions, or just getting very unlucky with the order of your transaction.
Proof of Concept
- UserA is looking to redeem their rToken for tokenA (the max the battery will allow, let’s say 100k)
- A basket refresh is about to be triggered
- Evil user wants the protocol to steal UserA’s funds
- UserA sends redeem TX to the mempool, but Evil user move transactions around before it hits
- Evil user calls refreshbasket in same block as original collateral (tokenA) is disabled, kicking in backupconfig (tokenB)
- Protocol is now undercollateralized but collateral is sound (tokenB is good)
- Evil sends 1tokenB to backingManager to UserA’s redeem has something to redeem
- UserA’s redemption tx lands, and redeems 100k rTokens for a fraction of tokenB!
UserA redeems and has nothing to show for it!
Evil user only had to buy 1 tokenB (or even less) to steal 100k of their rToken.
Tools Used
Hardhat
Recommended Mitigation Steps
Disallow redemptions/issuance during undercollateralization
Proof of Code
See warden’s original submission for full details.
Not sure this is distinct enough from the other attack vector to stand alone, leaving open for sponsor comment before duping.
Duplicate of
#399
Please note: the following comment and re-assessment took place after judging and awarding were finalized. As such, this report will leave this finding in its originally assessed risk category as it simply reflects a snapshot in time.
After re-reviewing, I do believe this should have been included in the M-04 batch of issues as well. As it is past the QA period, no changes will be made to awards, but I wanted to comment as such for the benefit of the sponsor.
Note: see mitigation status under M-04 below.
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 protocol allows redemptions while undercollateralised, so a redemption can be fulfilled with whatever small amount of backup collateral is present.
Impact
The victim could lose most of the value of their redeemed rTokens, receiving only a fraction of the expected collateral.
What the attacker needed
Victim submits a redemption transaction; attacker can order transactions; protocol becomes undercollateralised
The fix
The protocol should disallow redemptions and issuance during undercollateralisation.
How it was found
- UserA sends a redeem transaction to the mempool.
- Evil user reorders transactions before the redeem is mined.
- Evil user calls refreshBasket in the same block that the original collateral is disabled, activating the backup collateral.
- Evil user sends a tiny amount of backup collateral to the BackingManager.
- UserA's redemption transaction executes and redeems a large amount of rTokens for a fraction of the backup collateral.
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.
When you redeem tokens, you expect a fair amount of collateral back. Here, an attacker can arrange for your redemption to happen at a moment when the system is short of collateral and only a tiny amount of backup collateral is available, so you get almost nothing. The attacker does this by controlling the order of transactions in a block.
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.