Skip to content
Business logic Write-up Advanced

[web3] A bug in RAI found by vnmrtz.eth

A check on the available bad debt was performed before settling the system's coin balance, so after settlement the remaining debt could fall below the minimum auction size. An attacker could then trigger a debt auction for debt that no longer existed, causing unnecessary dilution of the protocol token.

mirror.xyz

Published on mirror.xyz

Its common to see projects hacked after an audit. After all, a security review doesn't guarantee a project is entirely free of bugs; it's more about enhancing security standards and uncovering as many potential issues as possible within a limited timeframe.

The author, on mirror.xyz

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the insufficient-debt check was performed before a debt-settlement call that reduces the debt, so the check used a stale value and the auction proceeded with less debt than the minimum bid size.

Impact

The protocol token could be unnecessarily diluted because bidders would buy non-existent debt in exchange for newly minted tokens; the text notes that at the time of reporting the protocol was in surplus, making debt auctions unlikely, but in a 'Black Thursday' scenario this could pose a recursive threat.

What the attacker needed

Protocol has bad debt; debt auction is triggered; settlement reduces debt below minimum

The fix

The issue was quickly addressed and fixed by the Reflexer team.

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 write-up has not been written yet. The Original tab links to the source.

A stablecoin system sometimes has bad debt that it tries to cover by auctioning its own tokens. This report found that a check on how much bad debt exists was done before a step that reduces that debt, so the auction could go ahead even when there was no debt left to cover. That would create and sell extra tokens for no reason, reducing the value of everyone else's tokens.

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.

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.