---
title: "Proxy, upgrade and initializer bugs"
url: https://dontgetrekt.today/dev/proxy-initializer
section: "Who can call it?"
owasp: SC10:2026
---

# Proxy, upgrade and initializer bugs

An upgradeable contract has an initializer that anyone can call, an implementation that nobody initialized, or a storage layout that an upgrade breaks.

## How the attack works

1. A proxy contract uses `initialize()` instead of a constructor. The function sets the owner.
2. The deployer forgets to call it, calls it in a separate transaction, or the function has no `initializer` modifier.
3. The attacker calls `initialize()` first, becomes the owner, and upgrades the proxy to a malicious implementation.
4. Variants: an uninitialized implementation that the attacker takes over and destroys, a new version that changes the order of state variables, a `delegatecall` into an address that the caller gives.

## Vulnerable code

```solidity
contract Vault is UUPSUpgradeable {
    address public owner;

    function initialize(address o) external {
        owner = o;             // no initializer guard: callable again
    }

    function _authorizeUpgrade(address) internal override {}  // no check
}
```

## Fixed code

```solidity
contract Vault is Initializable, UUPSUpgradeable, OwnableUpgradeable {
    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() { _disableInitializers(); }  // lock the implementation

    function initialize(address o) external initializer {
        __Ownable_init(o);
        __UUPSUpgradeable_init();
    }

    function _authorizeUpgrade(address) internal override onlyOwner {}
}
// Deploy the proxy and call initialize in the SAME transaction (constructor data).
```

## Review checklist

- Call `_disableInitializers()` in the constructor of every implementation contract.
- Initialize the proxy in the same transaction that deploys it.
- Protect `_authorizeUpgrade` (UUPS) or the proxy admin (Transparent) with an owner, a multisig and a timelock.
- Only add new state variables at the end. Use ERC-7201 namespaced storage or storage gaps.
- Never `delegatecall` to an address that a caller can choose.

## How to test for it

- Use the OpenZeppelin Upgrades plugin (Foundry or Hardhat). It checks storage layout and unsafe patterns before each upgrade.
- Write a test that calls `initialize()` a second time, and on the implementation directly. Both must revert.

## Real exploits (23)

- 2025-09-13 Unidentified presale project (possibly JUDAO; Fundpool proxy) ($20.0M): An unidentified presale project's proxy holding about 77M POL (~$20M) was permanently locked after a botched proxy upgrade pointed to a wrong implementation and wiped admin and upgrade roles. [rekt.news](https://rekt.news/who-got-rugged)
- 2024-08-06 Ronin Network ($12.0M): Ronin Network bridge lost about $12M (later returned) after an upgrade called initializeV4 but skipped initializeV3, leaving the operator weight at zero. [rekt.news](https://rekt.news/roninnetwork-rektII)
- 2021-05-05 Value DeFi ($10.0M): Value DeFi lost about $10M on BNB Chain because the vStake pool's initialize() lacked "initialized = true", so anyone could re-initialize it and take control. [rekt.news](https://rekt.news/value-rekt2)
- 2021-08-10 Punk Protocol ($8.9M): Punk Protocol lost $8.95M (about $5M later returned) because CompoundModel's initialize() had no initializer modifier, so an attacker could set their own forgeAddress. [rekt.news](https://rekt.news/punkprotocol-rekt)
- 2022-07-23 Audius ($6.0M): Audius lost about $6M of AUDIO tokens when an attacker exploited a proxy storage-slot collision with OpenZeppelin's Initializable to re-initialise governance contracts and pass a malicious treasury-draining proposal. [rekt.news](https://rekt.news/audius-rekt) [PoC](https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2022-07/Audius_exp.sol)
- 2023-02-24 EFVault (Earning.Farm) ($5.1M): EFVault (Earning.Farm) lost about $5.1M in USDC because of a storage collision in its proxy setup, which let an attacker redeem shares against the vault's assets. [PoC](https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2023-02/EFVault_exp.sol)
- 2021-09-04 DAO Maker ($4.0M): DAO Maker lost about $4M when its re-callable init() let an attacker reinitialise four token-holding contracts and drain them with emergencyExit(). [rekt.news](https://rekt.news/daomaker-rekt) [PoC](https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2021-09/DaoMaker_exp.sol)
- 2021-03-09 DODO ($2.0M): DODO lost about $2 million (article also cites ~$3.8M drained, ~$1.88M expected returned) from V2 Crowdpools because init() could be called multiple times, enabling a fake-token attack. [rekt.news](https://rekt.news/au-dodo-rekt) [PoC](https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2021-03/dodo_flashloan_exp.sol)
- 2024-04-30 Pike Finance ($1.9M): Pike Finance lost about $1.9M across two attacks (April 26 and April 30, 2024) on Ethereum, Arbitrum and Optimism, because a storage-layout change broke the initializer guard and let attackers take over the upgradeable contracts. [rekt.news](https://rekt.news/pike-rekt) [PoC](https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2024-04/PikeFinance_exp.sol)
- 2023-12-25 Telcoin ($1.2M): Telcoin lost about $1.24M on Polygon because a storage collision let an attacker call initialize() again on a CloneableProxy and delegatecall their own code. [PoC](https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2023-12/Telcoin_exp.sol)

## References

- [OWASP SC10:2026](https://scs.owasp.org/sctop10/SC10-ProxyAndUpgradeabilityVulnerabilities/)
- [SWC-112: Delegatecall to untrusted callee](https://swcregistry.io/docs/SWC-112/)
- [OpenZeppelin: Writing upgradeable contracts](https://docs.openzeppelin.com/upgrades-plugins/writing-upgradeable)
- [ERC-7201: Namespaced storage layout](https://eips.ethereum.org/EIPS/eip-7201)
