Skip to content
Smart contracts Audit finding Intermediate

An attacker can drain assets from a Closure by exploiting the NoopVault via a donation attack

The NoopVault contract lacks protection against ERC4626 donation attacks, allowing an attacker to front-run the first deposit and donate assets directly to inflate the share-to-asset ratio. This lets the attacker withdraw more assets than they deposited, draining funds from legitimate users.

TessKimy Follow with m3dython and x0lohaclohell

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-04-burve-judging/issues/387

Found by

TessKimy, m3dython, x0lohaclohell

Summary

The absence of protective mechanisms in the NoopVault as a vertex vault allows an attacker to exploit the ERC4626 standard's vulnerability to donation attacks. By front-running the first legitimate deposit and donating assets directly(without interacting with the valueFacet) to the vault without receiving shares, the attacker can manipulate the share-to-asset ratio. This manipulation enables the attacker to withdraw a disproportionate amount of assets, effectively draining each vertex in a Closure.​

Root Cause

There is no mechanism to prevent donation attacks, such as initializing the vault with a non-zero share supply or implementing virtual assets/shares. This omission allows an attacker to manipulate the vault's share-to-asset ratio by donating assets without receiving corresponding shares.

Solidity
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.27;
import "openzeppelin-contracts/token/ERC20/extensions/ERC4626.sol";
import "openzeppelin-contracts/token/ERC20/ERC20.sol";

contract NoopVault is ERC4626 {
    constructor(
        ERC20 asset,
        string memory name,
        string memory symbol
    ) ERC20(name, symbol) ERC4626(asset) {}
}

Internal Pre-conditions

  1. Admin adds a new NoopVault as a vertex in the Burve protocol.
  2. The vault has zero total supply and total assets upon initialization.
  3. No initial deposit is made to the vault to set a baseline share-to-asset ratio.

External Pre-conditions

  1. Berachain, being an L1 blockchain, has a transparent mempool where pending transactions can be observed.
  2. An attacker monitors the mempool for transactions adding new vertices (vaults) to the Burve protocol.

Attack Path

  1. Attacker observes a transaction in the mempool adding a new Vault as a vertex.
  2. Before any legitimate user adds value through the valueFacet, the attacker front-runs by depositing a minimal amount (e.g., 1 wei) directly into the vault, receiving all the initial shares.
  3. The attacker then donates a significant amount of assets directly to the vault without minting new shares, inflating the total assets.
  4. A legitimate user deposits assets into the vault, expecting to receive shares proportional to their deposit. However, due to the inflated asset pool and the attacker's control of all shares, the user receives fewer shares than expected.
  5. The attacker redeems their shares, withdrawing a disproportionate amount of assets from the vault, effectively draining the Closure.​

Impact

Users suffer significant losses as their deposits yield fewer shares than expected, leading to a loss in asset value and the attacker gains assets equivalent to the legitimate users deposits without providing corresponding value. This attack can be cordinated to target all vertices in a closure and drain the whole closure.

PoC

No response

Mitigation

Implement Virtual Assets/Shares: Incorporate virtual assets and shares in the vault's accounting to simulate an initial balance, mitigating the impact of donation attacks.

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/itos-finance/Burve/pull/79

The original report as published on Sherlock, by TessKimy. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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 vault does not initialise with a non-zero share supply or use virtual assets/shares, leaving the share-to-asset ratio manipulable by direct donations.

Impact

Users suffer significant losses as their deposits yield fewer shares than expected, leading to a loss in asset value and the attacker gains assets equivalent to the legitimate users deposits without providing corresponding value.

What the attacker needed

Admin adds a new NoopVault as a vertex; Vault has zero total supply and assets; No initial deposit made to vault; Attacker monitors mempool for new vertices

The fix

The protocol team fixed this issue in the following PRs/commits: https://github.com/itos-finance/Burve/pull/79

How it was found

  1. Attacker observes a transaction in the mempool adding a new Vault as a vertex.
  2. Before any legitimate user adds value through the valueFacet, the attacker front-runs by depositing a minimal amount (e.g., 1 wei) directly into the vault, receiving all the initial shares.
  3. The attacker then donates a significant amount of assets directly to the vault without minting new shares, inflating the total assets.
  4. A legitimate user deposits assets into the vault, expecting to receive shares proportional to their deposit. However, due to the inflated asset pool and the attacker's control of all shares, the user receives fewer shares than expected.
  5. The attacker redeems their shares, withdrawing a disproportionate amount of assets from the vault, effectively draining the Closure.

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 vault contract lets people deposit tokens and receive shares representing their portion. If an attacker is the first to deposit a tiny amount, they own all shares. They then send extra tokens directly to the vault without getting new shares, making each share worth more. When others deposit, they get fewer shares, and the attacker can later withdraw more than they put in, taking others' money.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by TessKimy

View all

6 more disclosed reports, best first.

More from Burve

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.