Skip to content
Smart contracts Write-up Advanced

Truebit Protocol Exploit: How a Silent Overflow Led to a $26M Los

The Truebit Protocol's pricing function used an outdated Solidity version that silently overflowed on large inputs, causing getPurchasePrice to return zero or near-zero ETH for huge token amounts. An attacker could then buy tokens for free and sell them for ETH, draining about 8,535 ETH.

Evgenii Follow

Published on coinsbench.com

On January 8, 2026, the Truebit Protocol suffered a catastrophic on-chain exploit that resulted in the loss of approximately 8,535 ETH (~$26M).

Evgenii, on coinsbench.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 contract was compiled with Solidity 0.6.10, which does not revert on integer overflow, so large multiplications in the pricing formula wrapped silently and produced a zero or tiny price.

Impact

The attacker could mint tokens for free and sell them for ETH, draining approximately 8,535 ETH (~$26M) from the protocol.

What the attacker needed

Ability to call the public buy and sell functions; no special privileges needed

The fix

The contract should be upgraded to Solidity 0.8 or later (or use SafeMath) and add sanity checks to reject zero or unreasonably low prices.

How it was found

  1. Call getPurchasePrice with a very large token amount; the overflow makes it return zero.
  2. Call buy with zero ETH, which mints the large token amount to the attacker.
  3. Approve the target contract to spend the minted tokens.
  4. Call sell to receive ETH from the reserve.
  5. Repeat the loop several times, then bribe the validator and send the profit to the owner.

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 is a program on a blockchain that holds and moves money. This one had a maths bug: when asked to calculate a very large price, the numbers wrapped around (like an old car odometer) and the result became zero. So the attacker got tokens for nothing and sold them back for real 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 Evgenii

View all

8 more disclosed reports, best first.

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.