Toutes les vulnérabilités
CRITICALWeb3exploited in the wild

WEB3-PICKLE-2020

Web3 · Ethereum · Pickle Finance

Résumé

On 21 November 2020 Pickle Finance lost about $19.7 million (roughly 19,759,355 DAI worth of cDAI) drained from its pDAI Jar strategy. The ControllerV4 contract exposed swapExactJarForJar(), which moved tokens between Jars but never verified that the supplied Jar addresses were legitimate, protocol-deployed Jars; there was no whitelist check. The attacker deployed malicious EvilJar contracts implementing the expected interface (token, getRatio, balanceOf, withdraw, deposit), and passed them as the swap source and destination, so the controller withdrew from the real strategy into attacker-controlled contracts. The exploit was compounded by an approved converter whose add_liquidity() built a call from user-controlled callData, enabling code injection, and by the strategy treating cDAI as dust; chaining these let the attacker route the strategy's ~19M cDAI out through the fake Jar's deposit() and redeem it for DAI.

Comment l’éviter dans votre code

  • Maintain an explicit allowlist of protocol-deployed Jars/strategies and reject any address not on it before moving funds
  • Never build and execute calls from user-controlled callData/targets; restrict converters to a fixed, audited set of functions
  • Treat interface conformance as no proof of trust; an attacker can implement every expected method on a malicious contract
  • Validate that swap source and destination are distinct, registered, and that returned balances come from trusted code paths
  • Avoid classifying core strategy assets (e.g. cDAI) as sweepable dust that bypasses normal withdrawal access control

Références

Vulnérabilités liées

Tout Web3 →