Skip to content
Smart contracts Write-up Advanced

Abracadabra, NGP, Kame: $5M Lost to Solvency Bypass, Price Games,

Abracadabra's cook() function allowed an attacker to borrow without collateral by clearing a solvency check. New Gold Protocol suffered price manipulation via flash loans, and Kame Aggregator allowed arbitrary external calls through swap().

Olympix Follow

Published on olympixai.medium.com

Three exploits, one theme: broken contract boundaries. Abracadabra’s cook() logic disabled its own collateral checks.

Olympix, on olympixai.medium.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 contracts failed to validate inputs and state changes: Abracadabra cleared a solvency flag, New Gold relied on a manipulable AMM price, and Kame allowed arbitrary external calls.

Impact

The three exploits together resulted in losses of about $5M, with Abracadabra losing $1.7M, New Gold $2M, and Kame $1.3M.

What the attacker needed

None for Abracadabra; flash loan for New Gold; users had token approvals for Kame

How it was found

  1. The attacker called cook() with actions [5, 0].
  2. Action 5 borrowed funds and set needsSolvencyCheck = true.
  3. Action 0 was undefined, so the else branch executed _additionalCookAction(), which cleared needsSolvencyCheck.
  4. The attacker then borrowed assets without collateral and made a profit.

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. In these three cases, the programs trusted inputs they should not have, letting attackers take funds they were not entitled to.

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 Olympix

View all

24 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.