Skip to content
Business logic Audit finding Intermediate

Vests can be denied

The vesting contract rejects a new vest if the user already has one, so an attacker can front-run a legitimate vest by creating a tiny vest for the victim, causing the original transaction to revert and denying the vest.

cmichel Follow

Originally disclosed on Code4rena

Submitted by cmichel

The LinearVesting.vestFor function (which is called by Converter) reverts if there already exists a vest for the user:

 require(
    vest[user].amount == 0,
    "LinearVesting::selfVest: Already a vester"
);

There’s an attack where a griefer frontruns the vestFor call and instead vests the smallest unit of VADER for the user. The original transaction will then revert and the vest will be denied

Recommended Mitigation Steps

There are several ways to mitigate this. The most involved one would be to allow several separate vestings per user.

SamSteinGG (Vader) confirmed)

The original report as published on Code4rena, by cmichel. 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 enforces a single vest per user by reverting if a vest already exists, without checking who created it or allowing multiple vests.

Impact

A legitimate vest can be denied, causing the transaction to revert and preventing the intended vesting.

What the attacker needed

Attacker can front-run transactions; victim has no existing vest

The fix

The contract should be changed to allow multiple separate vestings per user, as suggested in the mitigation steps.

How it was found

  1. Attacker sees a pending vestFor transaction for a victim.
  2. Attacker front-runs by calling vestFor for the same victim with the smallest possible amount.
  3. The victim's original transaction reverts because a vest already exists.
  4. The vest is denied.

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 vesting contract lets someone gradually receive tokens over time. The contract only allows one vest per user, so if an attacker creates a tiny vest for someone else first, that person's real vest fails because the contract sees they already have one. This is a griefing attack: the attacker doesn't gain anything but blocks the victim.

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 cmichel

View all

196 more disclosed reports, best first.

More from Vader Protocol 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.