Don't Get Rekt

Smart contract bugs / Who can call it?

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.

OWASP SC10:2026 · 23 real exploits · $73.1M lost

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 and fixed code

Vulnerable
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
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)

  • Sep 13, 2025Polygon$20.0M

    Unidentified presale project (possibly JUDAO; Fundpool proxy): 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.

    Root cause and fix

    Vulnerable code: Fundpool (Proxy) 0x7D341e757f893e1a13D40370d0F6065ca9c4777E

    A developer upgraded the proxy to a new implementation contract but did not reinitialize it, and per the article the wrong implementation was set. The upgrade wiped out the admin and upgrade roles, so nobody could call withdrawal or upgrade functions. The 77M POL collected in the presale is now stuck in the proxy with no way to recover it. The article also speculates this may have been an exit scam gone wrong, but offers no evidence.

    What would have stopped it: Test every proxy upgrade on a fork before mainnet. Check that the new implementation keeps the same storage layout, that initialization and role setup are done, and that admin and withdraw functions still work after the upgrade. Use a reviewed upgrade process with a multisig and an upgrade-safety tool such as OpenZeppelin Upgrades plugins.

    rekt.news article ↗

  • Aug 6, 2024Ethereum$12.0M

    Ronin Network: Ronin Network bridge lost about $12M (later returned) after an upgrade called initializeV4 but skipped initializeV3, leaving the operator weight at zero.

    Root cause and fix

    Vulnerable code: MainchainGatewayV3 · initializeV3()

    During the upgrade of the bridge to MainchainGatewayV3 (version 2 to 4), the team called initializeV4 but not initializeV3. As a result _totalOperatorWeight stayed at its default of zero, which effectively disabled the minimumVoteWeight check used to verify cross-chain withdrawals. An MEV bot noticed this and submitted a withdrawal that passed verification, taking about 4K ETH and 2M USDC, capped by the max single-transaction withdrawal limit.

    What would have stopped it: Make the upgrade and initialization a single scripted step. Test it on a fork, and assert that critical state such as total operator weight is non-zero after the upgrade. Have the withdrawal verification revert if the weight or threshold is zero, and have auditors review the deployment as well as the code.

    rekt.news article ↗

  • May 5, 2021BNB Chain$10.0M

    Value DeFi: 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.

    Root cause and fix

    Vulnerable code: vStake profit-sharing pool · initialize()

    The pool's initialize() function never set initialized = true, so it could be called again after deployment. The line was lost when the team migrated code from the old Value DeFi Reserve Fund, where it was correct. The attacker re-initialized the pool, made himself operator and set _stakeToken to a token of his own (HACKEDMONEY). He then called governanceRecoverUnsupported() to drain the original vBSWAP/BUSD LP tokens, burned them for vBSWAP and BUSD, sold the vBSWAP, and bridged the funds to BTC through renBridge.

    What would have stopped it: Set an initialized flag inside initialize() and require it is unset on entry, for example with OpenZeppelin's Initializable and its initializer modifier. Add a test that calls initialize() a second time and expects a revert. Review code carefully when merging it from older contracts.

    rekt.news article ↗

  • Aug 10, 2021Ethereum$8.9M

    Punk Protocol: 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.

    Root cause and fix

    Vulnerable code: CompoundModel · initialize()

    The initialize() function in CompoundModel had no initializer modifier, so anyone could call it again. The attacker called it and set forgeAddress to their own malicious contract. The onlyForge modifier on the withdrawal functions then trusted that address, so the attacker called withdrawToForge and moved the assets held by CompoundModel to their wallet.

    What would have stopped it: Protect initialize() with an initializer modifier (for example OpenZeppelin Initializable) so it can run only once, and initialize it in the same transaction as deployment. Add tests that a second call to initialize() reverts.

    rekt.news article ↗

  • Jul 23, 2022Ethereum$6.0MAudited

    Audius: 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.

    Root cause and fix

    Vulnerable code: AudiusAdminUpgradabilityProxy / Audius Governance contract · initialize()

    AudiusAdminUpgradabilityProxy stores the proxyAdmin address in storage slot 0, which collides with the Initializable contract's initialization flags. Because of this, the governance contracts could be re-initialised by the attacker. They took control of governance, changed the guardian and voting settings, and pointed the Staking and DelegateManagerV2 contracts at a custom governance contract. They then recorded fake delegations of 10 trillion AUDIO to themselves, passed a proposal, and moved 18.56M AUDIO out of the treasury.

    What would have stopped it: Use unstructured storage (for example EIP-1967 slots) for proxy admin data so it cannot collide with implementation variables like Initializable's flags. Add upgrade tests that check storage layouts and confirm initialize() cannot be called again after deployment.

    rekt.news article ↗Run the exploit (Foundry PoC) ↗

  • Feb 24, 2023Ethereum$5.1M

    EFVault (Earning.Farm): 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.

    Root cause and fix

    Vulnerable code: EFVault · redeem()

    The article title says storage collision, and the PoC is short. Storage variables in the vault proxy and its implementation overlapped, so critical state such as the owner, initialization flag or controller/asset settings was wrongly set or overwritten. The PoC gives the attacker only 1e18 ENF shares (via deal) and calls redeem(676_562, exploiter). That call drains the vault's USDC to the exploiter, which means redeem() relied on corrupted state. The exact colliding variables are not given in the text, so this part is inferred.

    What would have stopped it: Keep the storage layout of proxy and implementation identical and append-only. Check upgrades with a storage-layout tool such as OpenZeppelin upgrades plugin or forge inspect. Add tests that check redeem() cannot pay out more than the caller's shares are worth.

    Run the exploit (Foundry PoC) ↗

  • Sep 4, 2021Ethereum$4.0M

    DAO Maker: DAO Maker lost about $4M when its re-callable init() let an attacker reinitialise four token-holding contracts and drain them with emergencyExit().

    Root cause and fix

    Vulnerable code: DAOMaker vesting contracts (e.g. 0x2FD602Ed1F8cb6DEaBA9BEDd560ffE772eb85940) · init()

    DAO Maker's init() function could be called again after deployment, so anyone could reinitialise contracts with malicious data. The attacker reinitialised four contracts holding CAPS, CPD, DERC and SHO tokens, which made them the privileged party. They then called emergencyExit() on each one to withdraw the funds, and sold the tokens on 1inch and MetaMask Swap for DAI. The source code was not public, and the article says the audits were doubtful: two seemed to cover unrelated contracts and one linked to a dead page.

    What would have stopped it: Make init() callable only once, for example with an initializer modifier or an "already initialised" flag, and restrict it to the deployer. Test that a second call to init() reverts, and check that emergencyExit() is only callable by a trusted owner set at deployment.

    rekt.news article ↗Run the exploit (Foundry PoC) ↗

  • Mar 9, 2021Ethereum$2.0MFlash loan

    DODO: 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.

    Root cause and fix

    Vulnerable code: DODO V2 Crowdpooling · init()

    The DODO V2 Crowdpooling contract's init() function could be called more than once. The attacker initialized the pool with a counterfeit token and called sync() to set the reserve variable to 0. They then re-initialized the pool with a real token held by the pool. A flash loan then took all the real tokens and passed the flash loan check, because the recorded reserve was 0.

    What would have stopped it: Make init() callable only once, for example with an initialized flag or an initializer modifier, and test that a second call reverts. Also do not let the pool's base and quote tokens change after setup.

    rekt.news article ↗Run the exploit (Foundry PoC) ↗

  • Apr 30, 2024Ethereum$1.9M

    Pike Finance: 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.

    Root cause and fix

    Vulnerable code: Pike Finance spoke contract (proxy and upgraded implementation) · initialize()

    While trying to pause the protocol after the first exploit, the team added a dependency to the code. This changed the storage layout and moved the "initialized" variable, so the initializer protection stopped working. The attacker called the unprotected initialize() on the upgraded implementation and made themselves owner. They also used up version numbers so they could run new initialization steps with each upgrade. Then they called upgradeToAndCall to install a malicious implementation and drained the funds. The first attack on April 26 came from weak security in the CCTP transfer functions.

    What would have stopped it: Run storage-layout compatibility checks (for example the OpenZeppelin upgrades plugin) before every upgrade. Initialize implementation contracts and lock them with _disableInitializers(). Also test that initialize() reverts after deployment, and get an audit before upgrading with real funds.

    rekt.news article ↗Run the exploit (Foundry PoC) ↗

  • Dec 25, 2023Polygon$1.2M

    Telcoin: 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.

    Root cause and fix

    Vulnerable code: CloneableProxy (0x56BCADff30680EBB540a84D75c182A5dC61981C0) · initialize()

    The CloneableProxy's initializer state (_initialized and _initializing, packed in slot 0) was reset or collided with other storage after an upgrade. The proxy therefore looked uninitialized and initialize(address _logic, bytes data) could be called again. The attacker passed their own contract as the logic address and gave it calldata for a function. The proxy delegatecalled that function, which transferred all the proxy's TEL tokens to the attacker.

    What would have stopped it: Keep the storage layout compatible across upgrades. Check upgrades with layout-diff tools such as OpenZeppelin's upgrades plugin. Make sure initializer flags cannot be overwritten, and restrict initialize() on proxies to the deployer or an authorized caller. Do not delegatecall to an arbitrary logic address.

    Run the exploit (Foundry PoC) ↗

13 more examples in the full guide.

References

Send a new scam

Describe what happened, or paste a link to the post. Do not include seed phrases, keys or passwords.

Open the post ↗