Skip to content
Smart contracts Write-up Advanced

Wormhole Uninitialized Proxy Bug Fix Review

The Wormhole core bridge contract on Ethereum had an uninitialized implementation contract, allowing an attacker to become the Guardian and force an upgrade to a malicious contract that self-destructs, potentially locking up user funds.

immunefi.com

Published on immunefi.com

On February 24th, a whitehat who goes by the pseudonym satya0x, responsibly disclosed a critical bug in the Wormhole core bridge contract on Ethereum. This bug was an upgradeable proxy implementation self-destruct bug that could have led to a potential lockup of user funds.

The author, on immunefi.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The implementation contract was left uninitialized after a previous bugfix reverted the initialization, allowing anyone to call initialize() and become the Guardian.

Impact

The bug could have led to a potential lockup of user funds, but no user funds were lost as the issue was fixed the same day it was reported.

What the attacker needed

Uninitialized implementation contract; Ability to call initialize(); Ability to deploy a malicious contract

The fix

The issue was fixed by calling initialize() on the implementation contract to set the Guardians.

How it was found

  1. The attacker calls initialize() on the implementation contract to set the attacker controllable Guardian set
  2. Attacker deploys a malicious contract with a selfdestruct() function
  3. The attacker calls submitContractUpgrade() on the implementation contract and passes a signature signed by the malicious Guardian, which encodes the address of the malicious implementation contract for an upgrade
  4. During the submitContractUpgrade() execution, DELEGATECALL is called from the regular implementation contract to the malicious implementation contract
  5. SELFDESTRUCT is called, destroying the regular implementation contract
  6. The proxy contract is now rendered useless

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A proxy contract lets developers upgrade a smart contract's code without losing its data. If the proxy's implementation contract is left uninitialized, an attacker can claim ownership and then trick the proxy into destroying itself, making the contract unusable and potentially freezing funds.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.