Skip to content
Smart contracts Write-up Advanced

VeChainThor

A flaw in VeChainThor's self-destruct logic failed to settle accrued VTHO when the transferred amount was zero, allowing an attacker to repeatedly trigger self-destruct with flash-loaned VET to artificially mint large amounts of VTHO. This could lead to direct loss of funds.

immunefi.com

Published on immunefi.com

A critical vulnerability was discovered and reported by whitehat @nnez (one of the top 50 whitehats on Immunefi) on December 12, 2024. This flaw enables an attacker to artificially mint a large amount of VeThor Token(VTHO) by exploiting a flaw in the self-destruct logic in combination with a flash loan sourced from…

The author, on immunefi.com

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 self-destruct handler only updates the accrued VTHO balance when the transferred VET amount is non-zero, skipping settlement when the amount is zero.

Impact

An attacker could artificially mint a large amount of VTHO, leading to direct loss of funds.

What the attacker needed

Access to VeChain DEXes for flash loans; Ability to deploy and interact with contracts

The fix

The vulnerability was fixed by VeChain in a critical update.

How it was found

  1. Borrow a large amount of VET using flash loans from VeChain’s DEXes.
  2. Create a contract that triggers a self-destruct operation to transfer balances.
  3. Because the self-destruct logic does not settle accrued VTHO when the sent amount is zero, repeatedly invoking it allows the attacker to mint additional VTHO.
  4. By orchestrating multiple self-destruct events (using flash loans), the attacker can compound the amount of artificially minted VTHO.

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.

VeChainThor is a blockchain where holding VET generates VTHO over time, like interest. When a contract self-destructs, the code is supposed to first calculate and save any VTHO earned so far. But if the contract sends zero VET, that calculation is skipped, so the earned VTHO is not recorded. An attacker can exploit this by repeatedly self-destructing contracts with flash-loaned VET, causing the system to mint extra VTHO each time.

What is Smart contracts?

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

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.