Toutes les vulnérabilités
CRITICALWeb3exploited in the wild

WEB3-PARITY-2017

Web3 · Ethereum · Parity Multisig Wallet

Résumé

The Parity multisig wallet (version 1.5+) suffered two distinct incidents rooted in the same flaw. On 19 July 2017 an attacker stole 153,037 ETH (~$30M) from several wallets, and on 6 November 2017 the user devops199 accidentally froze 513,774 ETH (~$150M+ across 587 wallets) permanently. Each thin wallet contract held no logic and used delegatecall to forward unmatched calls to a single shared WalletLibrary, which executed in the caller's storage context. The library's initWallet (calling initMultiowned) was a public function with no initialized guard, so in July the attacker called initWallet on a deployed wallet to overwrite m_owners with only their own address and m_required to 1, then called execute() to drain it. In November devops199 called the unprotected initWallet directly on the shared WalletLibrary itself (whose own storage was still uninitialized, bypassing the post-July fix that only checked the caller's m_numOwners), became its owner, then called the library's kill() which ran selfdestruct, deleting the shared code and bricking every wallet that delegatecalled into it.

Comment l’éviter dans votre code

  • Protect every initializer with an initialized guard or OpenZeppelin Initializable; never leave init() publicly re-callable
  • Treat any library reached via delegatecall as part of your trust boundary; deploy it initialized and locked
  • Do not use delegatecall as a catch-all fallback; explicitly whitelist which library functions are externally reachable
  • Gate selfdestruct and ownership-changing paths behind explicit access control, and prefer removing selfdestruct entirely
  • After deploying a singleton implementation, call its initializer immediately so no one else can claim it

Références

Vulnérabilités liées

Tout Web3 →