Toutes les vulnérabilités
CRITICALWeb3

WEB3-BADGERDAO-2021

Web3 · Ethereum · BadgerDAO

Résumé

BadgerDAO lost approximately $120M in a front-end/supply-chain attack rather than a smart-contract exploit, with malicious code first injected around November 10, 2021 and the mass drain on December 1-2, 2021. An attacker obtained a Cloudflare API key that was created on Badger's account without engineers' authorization and used without tripping the two-factor authentication that should have been enabled, then used Cloudflare Workers to inject malicious JavaScript into the app.badger.com front end. The script silently inserted unlimited ERC-20 spend approvals (approve/increaseAllowance) granting the attacker's address spending rights, disguised as the user's normal deposit/withdraw transaction. After roughly 500 wallets had granted these approvals, the attacker called transferFrom to drain their tokens; the Badger team halted the attack by freezing all transferFrom calls and pausing vaults. This became the canonical example of an 'ice phishing' unlimited-approval front-end attack.

Comment l’éviter dans votre code

  • Enforce mandatory 2FA, audit-logged access, and alerting on all CDN/edge accounts (Cloudflare) to detect unauthorized API keys or Workers.
  • Serve dApp front ends with Subresource Integrity and a strict Content-Security-Policy to block injected or tampered scripts.
  • Prompt users to grant exact-amount approvals instead of unlimited allowances, and surface clear approval details in the UI.
  • Monitor on-chain for anomalous approval spikes to a single spender and pause transferFrom on detection.
  • Pin and integrity-verify front-end deployments; review edge configuration changes through multi-party approval.

Références

Vulnérabilités liées

Tout Web3 →