Skip to content
Business logic Write-up Advanced

[web3] Critical bug in Eco found by merkle_bonsai

The Lockup contract allowed an attacker to extend a victim's lockup period by depositing zero tokens to the victim, causing the victim to lose rewards or funds. A second bug let an attacker manipulate delegation to permanently freeze a victim's funds.

mirror.xyz

Published on mirror.xyz

2 bugs are covered within this article. I reported high (as I considered) bug last December, but project told they already fixed several things, including this issue, after another bug report, and their actual addresses are handling all of cases properly.

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 depositFor function allowed anyone to modify any user's deposit record, including extending the lockup end time and changing the delegate, without proper checks or access control.

Impact

The attacker could cause the victim to lose funds by forcing an early withdrawal penalty, and in the second bug, permanently freeze the victim's funds.

What the attacker needed

Victim has funds deposited in Lockup; Attacker can call depositFor; Attacker can use MEV

How it was found

  1. Attacker calls depositFor with zero amount and the victim's address as benefactor.
  2. This increases the victim's lockupEnd to now + duration.
  3. Attacker uses MEV to place this transaction before the victim's withdrawal.
  4. Victim's withdrawal is treated as early, so they pay a penalty and lose rewards.

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 smart contract let anyone add a tiny deposit to someone else's locked funds, which extended the time those funds had to stay locked. This meant the victim could lose money if they tried to withdraw early, and in a second bug, an attacker could mess with voting power to permanently block withdrawals.

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.