BadgerDAO’s front end is injected to drain about $120 million

ATG-class event10 November to 2 December 2021

A script injected at the CDN edge into a crypto service’s web app quietly added token approvals to users’ transactions for three weeks, then drained their funds in a single day.

Position
The service’s CDN account, through API keys created without the team’s knowledge
Reach
About 500 wallets granted approvals; net losses about $120 million
Category
CDN Compromise
Effect
Deceive

What happened

BadgerDAO ran a decentralized finance service with a web front end behind Cloudflare. An attacker created API keys for its Cloudflare account without the team's knowledge, using a weakness in account registration, and from 10 November 2021 used Cloudflare Workers to inject a script into the app from time to time. When users made ordinary transactions, the script added an approval that let the attacker's address spend their tokens. On 2 December the attacker used those approvals. More than $130 million moved, about $9 million was recoverable, and net losses were around $120 million. One address lost about 900 BTC.

A user had reported a suspicious approval on Discord before the theft, and it was not investigated. Cloudflare said its own systems were not compromised.

The ATG nexus

The smart contracts worked as written. The interface lied. Users saw a normal transaction from the service they trusted and approved what their wallet put in front of them, and the extra approval rode along. The injection lived at the delivery edge, so the service's own code and servers were untouched. And the attacker waited three weeks between the first injection and the theft, collecting approvals in silence.

Limits of the comparison

The users' wallets displayed the approval request, so a careful reader of every prompt could have refused it. The account takeover was specific to this service's CDN account. No primary post-mortem from BadgerDAO was retrieved for this page.

On this site

Sources

  1. BadgerDAO Reveals Details of How It Was Hacked for $120MCoinDesk, 10 December 2021
  2. BadgerDAO team reveals details of $121 million hackForkLog, 11 December 2021
  3. Explained: The BadgerDAO Hack (December 2021)Halborn, December 2021
  4. BadgerDAO Post-Mortem Details Fourth-Largest DeFi ExploitBeInCrypto, December 2021

Back to this event on the timeline