Skip to content
Yieldo

Badger DAO

$120.0M
Funds stolen
Funds returned
02 Dec 2021
Date of incident
Technique
CDN Compromise
Classification
Frontend & Infrastructure
Target type
DeFi Protocol
Affected chains
Ethereum
Source
No public source link

On December 2, 2021, at roughly 00:00 UTC, an attacker began draining Ethereum wallets connected to BadgerDAO, a Bitcoin-focused yield aggregator. Over the next two hours and twenty minutes — until the team paused all smart-contract calls — more than 500 addresses were drained of wBTC and other ERC-20 tokens. BadgerDAO's own post-mortem put the gross theft at around $130 million, of which roughly $9 million never actually left the protocol's vaults (CoinDesk). The exploit did not touch a single line of Badger's smart contracts — it compromised the website that served them.

How the attack worked

The entry point was BadgerDAO's Cloudflare account, the edge/CDN service running app.badger.com. According to Badger's own post-mortem, the attacker obtained "a compromised API key that was created without the knowledge or authorization of Badger engineers" and used it to inject a malicious JavaScript snippet into the live front end — code that, per Rekt.news, appears to have been sitting there for close to two weeks before it activated against most victims.

The script did not present users with an obviously suspicious transaction. Instead, it silently piggybacked on the deposit and reward-claim calls people were already making, appending a call to the token's increaseAllowance() function. Signing what looked like a routine Badger transaction also handed the attacker's address unlimited permission to move the signer's wBTC and other tokens (Vice). Because the code was served from Badger's real, correctly-signed domain, the usual checks — the padlock icon, the URL bar, even a cautious glance at where the transaction was headed — did not flag anything unusual for most users; only reading exactly what permission was being requested (an unlimited approve rather than a bounded transfer) would have caught it.

Once enough wallets carried the poisoned allowance, the attacker called transferFrom() against them one after another, sweeping out tokens until Badger noticed the pattern of drained accounts and froze all contract calls, roughly two hours and twenty minutes after the draining began.

What happened next

Badger revoked the compromised API key, rotated its Cloudflare credentials, and brought in incident-response firm Mandiant alongside blockchain analytics firm Chainalysis to trace the funds and reconstruct the attack. Law enforcement in the United States and Canada was notified and worked with the team on recovery. Of the roughly $130 million drawn against user approvals, about $9 million was never actually withdrawn from Badger's vaults and stayed under the protocol's control; the rest moved to the attacker's addresses. None of the sources reviewed report an identification or arrest of the attacker, a negotiated return of funds, or a bounty outcome — the case appears to remain unresolved in public reporting. The coverage available does not document whether, or on what terms, the protocol resumed normal operation afterward.

What follows from this

  • Any DeFi product with a web front end depends on the security of ordinary web infrastructure — CDN, DNS, hosting accounts — not just its audited contracts. A clean Solidity audit says nothing about whether the site serving that contract's interface can be trusted.
  • The specific mechanic — a hidden call riding along with a legitimate transaction — defeats the domain checks users are normally taught to rely on, because the malicious code was served from the real, correct site. The only reliable defense is reading what a wallet's transaction preview actually authorizes before signing, not just verifying the URL.
  • Unlimited token approvals were the specific primitive this attack abused: one signature, unbounded future access. Revoking stale approvals periodically, or using interfaces that request capped allowances instead of unlimited ones, limits how much a single compromised front end can take.
  • The incident pushed CDN/edge-provider account hygiene — API key scoping, two-factor authentication, key rotation — into the same risk category as smart-contract audits for teams running user-facing DeFi interfaces.

On-chain DeFi carries smart-contract risk. Keep core funds on a regulated exchange.