Skip to content
DoS Audit finding Beginner

An attacker can DoS vault’s buyout with as little as 1 wei per 4 days

A user can start a buyout with as little as 1 wei, and while that buyout is active no one else can start another buyout on the same vault. An attacker can therefore block legitimate buyouts for up to 4 days at negligible cost.

0xA5DF Follow

Originally disclosed on Code4rena

Submitted by 0xA5DF, also found by 0x52, 0xDjango, 0xsanson, async, berndartmueller, cccz, hubble, kenzo, Lambda, PwnedNoMore, Ruhum, scaraven, shenwilly, sseefried, Treasure-Seeker, xiaoming90, and xiaoming90

The underlying issue here is:

  • A user can create a buyout with as little as 1 wei (which is basically nothing, it’s worth about 1e-15 USD), without any fractions
  • Once a buyout is created, nobody else can create another buyout on the same vault till the previous buyout ends (even if he’d like to offer a much higher price)

This leads to the fact that with as little as 1 wei a user can block a vault from holding a buyout for 4 days.

Impact

This can make the buyout module unavailable for a vault for days.

This can either be used in general, or to front-run and prevent a specific buyout offer.

Proof of Concept

I’ve added the following test to test/Buyout.t.sol, and it passes (i.e. the bug exists)

    function testStartWith1Wei_bug() public {
        initializeBuyout(alice, bob, TOTAL_SUPPLY, 0, true);

        // bob holds zero fractions, and can still start a buyout
        assertEq(getFractionBalance(bob.addr), 0);

        // Bob starts a buyout with as little as 1 wei
        bob.buyoutModule.start{value:1}(vault);

        // almost 4 days have passed but Alice still
        // can't start a buyout till Bob's buyout ends
        vm.warp(block.timestamp + 3.9 days);

        // the next call would revert with the `invalid state` error
        vm.expectRevert(
            abi.encodeWithSelector(
                IBuyout.InvalidState.selector,
                0,1
            )
        );
        // Alice can't start a buyout till eve's buyout ends
        alice.buyoutModule.start{value: 1 ether}(vault);
    }

Tools Used

Foundry

Recommended Mitigation Steps

  • While a buyout is running - allow other users to offer a higher buyout

    • This can either be a continuation of the previous buyout, or start a new one with proposal/rejection period starting form the current time.
    • In case it restarts the buyout - you’d might want to require a minimum increase from the previous buyout price (e.g. 5% more than the previous one), in order to prevent a buyout from running forever
  • Alternately, you can require a user to hold a minimum percent of fractions to start a buyout, this way if the offer is unrealistically low - the user would loose his fractions. Effectively putting a price tag for DoS-ing a vault.

aklatham (Fractional) confirmed

HardlyDifficult (judge) commented:

Unrealistic proposals can prevent legit offers from being made for a period of time, and that can be repeated to attempt to DOS. Agree with the warden’s severity of Medium risk since there is an opportunity for the legit proposal to be included after the griefing one expires.

Selecting this instance as the primary for including a clear coded POC.


The original report as published on Code4rena, by 0xA5DF. 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 allows a buyout to be started with a negligible amount and prevents any concurrent buyout, so a low-value buyout locks out higher offers until it expires.

Impact

The buyout module can be made unavailable for a vault for days, and this can be used to front-run and prevent a specific buyout offer.

What the attacker needed

A vault with the buyout module; 1 wei to start a buyout

The fix

The contract should either allow higher buyout offers while one is running (possibly requiring a minimum increase) or require a minimum fraction holding to start a buyout.

How it was found

  1. Bob holds zero fractions but calls the buyout start function with 1 wei.
  2. Almost 4 days pass.
  3. Alice tries to start a buyout with 1 ether but the call reverts with an invalid state error.

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 buyout is a way to offer to buy all the shares of a vault. The contract lets anyone start a buyout with almost no money, and while it runs nobody else can start one. So an attacker can pay a tiny amount to stop real buyers for days.

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 0xA5DF

View all

35 more disclosed reports, best first.

More from Fractional v2 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.