Arbitrum
The DelayedInbox contract's initialize function could be called again because a post-upgrade function wiped the initialisation flags, allowing an attacker to set their own bridge address and redirect all ETH deposits. The attacker could steal any ETH bridged to Arbitrum.
medium.com
Published on medium.com
Ethereum
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.
Context
Arbitrum Nitro is Arbitrum's L2 implementation, and the bridge from Ethereum into it relies on the DelayedInbox contract. As the Arbitrum documentation quoted in the write-up puts it:
a client can send a message to the Sequencer by signing and publishing an L1 transaction in the Arbitrum chain's Delayed Inbox. This functionality is most commonly used for depositing ETH or tokens via a bridge.
The DelayedInbox contract at [redacted] uses a standard TransparentUpgradeableProxy pattern with a public initialize() function. That function carries an initializer modifier, which checks the first two storage slots on the proxy to see whether the contract has already been initialised or is currently being initialised. In normal operation the contract is initialised once, the bridge and sequencerInbox address slots are set, and users deposit ETH through depositEth().

The author hunts bug bounties posted on ImmuneFi, is chain agnostic (unless the block explorer is garbage) and focuses on vulnerabilities inside Solidity smart contracts, with a current interest in the cross-chain arena because of the complexity for developers and the funds at risk in the honeypot structure of most bridge implementations. The premise is simple: developers will make a mistake during development, deployment or upgrade, and the challenge is finding where they slipped up before someone else does. An uninitialised address variable in Solidity is always worth pausing over, because it may have been left that way on purpose or by accident.
Setup
The author had explored the code for both Optimism and Arbitrum a few weeks earlier and had a solid understanding of how each protocol worked and how each implemented its security framework. Knowing Arbitrum Nitro was launching soon, the plan was to keep tabs on it and check the contracts afterwards to see whether the upgrade had been a success. Etherscan showed the deployed state, and the author scanned storage slots with Foundry's cast.
Finding it
The starting point was the initialize() function of the DelayedInbox contract.


The report states that in the first image the bridge and sequencerInbox address slots are both set upon initialisation. But pulling up Etherscan showed that the bridge was set correctly while the sequencerInbox was uninitialised. That contradiction was the thread to pull: the contract had clearly been initialised, yet one of the slots written during initialisation was empty.
The author scanned the first two storage slots of the contract with cast to see what had happened to the two booleans set during execution of the initializer modifier. Both slots 0 and 1 were empty, which meant the contract was in a completely vulnerable state while accepting thousands of ETH of deposits each day. The question was how that was possible given that the contract had previously been initialised.
The answer came from the trace logs: a call to a function called postUpgradeInit.

postUpgradeInit wipes slots 0, 1 and 2 and sets the bridge and allowListEnabled slots to new values, but leaves sequencerInbox and the two booleans set by the initializer modifier empty. The wiped initialisation state is what made re-initialisation possible.
Exploitation
Step 1: notice the removed guard
Calling the public initialize() function and setting your own address as the bridge to accept all incoming ETH deposits would normally be blocked, but only because of a gas optimisation made in the code a month earlier. Since the bridge address was already set, the check below would have prevented re-initialisation, had it not been removed in the never-ending battle for lower transaction costs.

Step 2: re-initialise with a spoofed bridge
With the initializer booleans wiped and the guard removed, the public initialize() function can be called again, setting the attacker's own bridge contract address. From that point all incoming ETH deposits from users attempting to bridge to Arbitrum via depositEth() are hijacked.

Step 3: choose a harvesting strategy
The author lists three options: selectively target large ETH deposits to remain undetected for longer, siphon every single deposit that comes through the bridge, or wait and front-run the next massive ETH deposit by calling initialize() with the malicious bridge contract. The largest deposit recorded on the inbox contract was 168,000 ETH (about $250mm), with typical total deposits in a 24 hour period ranging from about 1000 to about 5000 ETH.
Step 4: proof of concept
The PoC script calls initialize(), deploys the spoofed bridge, mimics a user calling depositEth() and shows the bridge balance increase.


Root cause
The chain of mistakes is: postUpgradeInit wipes slots 0, 1 and 2 and rewrites only bridge and allowListEnabled, leaving sequencerInbox and the two initializer booleans empty; the initializer modifier therefore no longer sees the contract as initialised; and the check that would have refused re-initialisation because bridge was already set had been removed as a gas optimisation. The combination turns a one-time initialisation into a repeatable one, and the repeatable initialisation lets an attacker point the bridge slot at their own contract. The existing defences, the initializer modifier and the bridge-already-set check, each failed for a separate reason: the first because its state was wiped by the upgrade path, the second because it no longer existed.
Impact
Any would-be depositor attempting to bridge funds from Ethereum to Arbitrum Nitro could have their deposit redirected to the attacker's contract. The author describes this as a multi-million dollar vulnerability, notes that the contract was accepting thousands of ETH of deposits each day, and cites a largest recorded deposit of 168,000 ETH (about $250mm) and typical 24 hour totals of about 1000 to about 5000 ETH. The attacker could take everything, take only large deposits to stay undetected, or front-run the next massive deposit by re-initialising with the malicious bridge.
Fix
The write-up does not describe the fix that was applied. The Arbitrum team provided a 400 ETH bounty, which the author thanks them for.
Variants to test
- Upgrade hooks that clear initialisation state. Look for functions such as postUpgradeInit or reinitializer routines in upgradeable proxies and check whether every slot written by the original initializer is rewritten. A positive result is a slot that the initializer sets and the upgrade hook leaves empty, visible with cast against the proxy's storage.
- Removed guards in upgradeable contracts. Diff the current implementation against earlier versions and look for deleted checks that protected initialisation or privileged setters. A positive result is a deleted check whose absence allows a state change that the earlier version rejected.
- Public initializers on live proxies. For any TransparentUpgradeableProxy with a public initialize(), read the initializer booleans and the address slots on chain. A positive result is an empty initializer slot on a contract that is already handling user funds.
- Uninitialised address variables. Grep for address state variables that are read but never set on a given deployment path. A positive result is a slot that Etherscan shows as set while direct storage reads show it empty, or the reverse.
- Deposit paths that trust a stored address. Trace functions such as depositEth() to see whether the destination is read from a mutable slot. A positive result is a deposit that can be redirected by changing that slot rather than by changing the caller.
What happened, in plain words
Arbitrum is a system that lets people use Ethereum, the main public blockchain, more cheaply. Instead of doing every piece of work on Ethereum itself, Arbitrum does the heavy lifting on its own chain and only records the important results back on Ethereum. To get money from Ethereum onto Arbitrum, you use a bridge: you send your ETH (the currency of Ethereum) to a special contract on Ethereum, and the same amount appears for you on Arbitrum.
A contract is a small program that lives on a blockchain. Once deployed, anyone can call the functions it exposes, and it holds money and data according to the rules written in its code. The contract in this story is called DelayedInbox, and it is the front door for deposits coming from Ethereum into Arbitrum Nitro (Nitro was the name of a major Arbitrum upgrade).
The DelayedInbox contract had a serious flaw. Its setup function, the one that records which bridge contract it should forward deposits to, could be run a second time by anyone. An attacker could run it with their own contract address in place of the real bridge, and from then on every deposit passing through the inbox would be sent to the attacker instead of to Arbitrum. The author of this write-up found the flaw, and the Arbitrum team provided a 400 ETH bounty.
This article walks through the same story step by step, explaining each idea from scratch: what a contract is, what a storage slot is, what an upgradeable proxy is, why an initialisation function exists, and how a small gas optimisation removed a safety check that would otherwise have stopped the attack.

The image above shows the author's Twitter handle, twitter.com/0xriptide.
Who found it and how they work
The author hunts for bug bounties posted on ImmuneFi. A bug bounty is a public offer from a company: find a flaw in our software, report it privately, and we will pay you a reward. ImmuneFi is a website that lists such offers.
The author describes themselves as chain agnostic, meaning they do not specialise in one blockchain, unless the block explorer is garbage. A block explorer is a website, such as Etherscan, that lets anyone look up what is stored on a blockchain: contracts, transactions, balances. The author focuses on vulnerabilities inside smart contracts written in Solidity, the programming language most Ethereum contracts are written in. Their current interest is the cross-chain arena, meaning systems that move value between different blockchains, because these systems are complex for developers and hold large amounts of money. The author calls most bridge implementations a honeypot structure: a tempting pile of funds that attracts attackers.
The reasoning behind the hunt is simple. Developers will make a mistake at some point, during development, deployment or upgrade of a contract. The challenge is finding where they slipped up before someone else does. One specific habit is called out: when you see an uninitialised address variable in Solidity, pause and investigate. An address variable is a slot in the contract's memory meant to hold the address of another contract or a person's wallet. Uninitialised means nothing has been written into it yet. It might have been left that way on purpose, or by accident, and the difference matters.
Getting ready
A few weeks before the events in this story, the author had read through the code of both Optimism and Arbitrum, two competing systems that scale Ethereum. That reading gave a solid understanding of how each protocol worked and how each implemented its security framework. Knowing that Arbitrum Nitro was about to launch, the plan was to keep an eye on it and check the contracts afterwards to see whether the upgrade had gone well.
The tools used were Etherscan, to read the deployed state of the contract, and Foundry's cast, a command-line tool that can read a contract's storage slots directly from a blockchain node. A storage slot is one numbered box in a contract's permanent memory. Contracts keep their variables in these numbered boxes, and anyone can read them.
Finding it
The starting point was the initialize() function of the DelayedInbox contract. To understand why, you need a little background on how upgradeable contracts work.
A normal contract, once deployed, cannot be changed. That is a problem for a project that needs to fix bugs later. The common solution is the TransparentUpgradeableProxy pattern. A proxy is a contract that holds all the money and all the storage, and it forwards every call it receives to a second contract, the implementation, which contains the actual logic. To upgrade, the project points the proxy at a new implementation. The storage stays where it is, in the proxy, and only the code changes. Think of it as a shop: the building and the stock stay the same, but you can swap out the staff who know how to run it.
Because the proxy's storage starts empty, the implementation needs a setup function to fill in the first values: which bridge to use, which sequencer inbox to use, and so on. That function is initialize(). It is public, meaning anyone can call it, so it must protect itself against being called twice. Otherwise an attacker could call it first and set themselves up as the owner. The protection is the initializer modifier, a piece of code that runs before the function body. It checks the first two storage slots on the proxy to see whether the contract has already been initialised or is currently being initialised. If either is true, the call is rejected.

The image is captioned "initialize function".

The image is captioned "initializer modifier".
In the first image, the bridge and sequencerInbox address slots are both set when the contract is initialised. That is the expected state: the contract knows which bridge to forward deposits to and which sequencer inbox to talk to. The sequencer is the part of Arbitrum that orders transactions.
But pulling up Etherscan showed something odd. The bridge slot was set correctly, while the sequencerInbox slot was uninitialised. That contradiction was the thread to pull. The contract had clearly been initialised at some point, because the bridge address was there, yet one of the slots written during initialisation was empty.
So the author scanned the first two storage slots of the contract with cast, to see what had happened to the two booleans set during execution of the initializer modifier. A boolean is a value that is either true or false. The initializer uses two of them, one meaning "already initialised" and one meaning "currently being initialised". Both slots 0 and 1 were empty. That meant the contract was in a completely vulnerable state while accepting thousands of ETH of deposits each day. The question was how that was possible, given that the contract had previously been initialised.
The answer came from the trace logs. A trace log is a detailed record of every internal call a transaction made, step by step, like a receipt that lists every room a visitor walked through. In those logs the author found a call to a function called postUpgradeInit.

The image is captioned "postUpgradeInit, not good." and relates to the call found in the trace logs.
postUpgradeInit wipes slots 0, 1 and 2 and sets the bridge and allowListEnabled slots to new values, but leaves sequencerInbox and the two booleans set by the initializer modifier empty. In plain terms: the upgrade routine cleared the boxes that record "this contract has been set up", and then only refilled some of them. The wiped initialisation state is what made re-initialisation possible. The contract no longer remembered that it had already been set up.
Exploitation
Step 1: notice the removed guard
Calling the public initialize() function and setting your own address as the bridge, so that all incoming ETH deposits go to you, would normally be blocked. But only because of a gas optimisation made in the code a month earlier.
Gas is the fee paid for every operation a contract performs. Developers constantly look for ways to do the same work with fewer operations, because that makes transactions cheaper for users. One such optimisation removed a check. Since the bridge address was already set, the check below would have prevented re-initialisation, had it not been removed in the never-ending battle for lower transaction costs.

The image is captioned "remove moot check", optimizing always has trade-offs.
A guard is a check that stops an action when conditions are wrong. Here the guard said, in effect: if a bridge address is already recorded, refuse to set it again. Removing it was harmless as long as the initializer booleans still worked, because those booleans would have blocked the second call anyway. But the upgrade routine had wiped those booleans. Two locks protected the same door, and now both were gone.
Step 2: re-initialise with a spoofed bridge
With the initializer booleans wiped and the guard removed, the public initialize() function can be called again, this time setting the attacker's own bridge contract address. A spoofed bridge is a fake contract that looks, to the inbox, like the real bridge. From that point, all incoming ETH deposits from users attempting to bridge to Arbitrum via depositEth() are hijacked. The depositEth() function is the one users call when they want to send ETH across; it reads the stored bridge address and forwards the money there.

The image is captioned "deposits are fed directly into the spoofed bridge".
Step 3: choose a harvesting strategy
The author lists three options for an attacker:
- Selectively target large ETH deposits, to remain undetected for longer.
- Siphon every single deposit that comes through the bridge.
- Wait and front-run the next massive ETH deposit by calling initialize() with the malicious bridge contract. Front-running means acting just before someone else's transaction is processed, so that your action takes effect first.
The largest deposit recorded on the inbox contract was 168,000 ETH, about $250mm. Typical total deposits in a 24 hour period ranged from about 1000 to about 5000 ETH. Those numbers show the scale of what was at stake.
Step 4: proof of concept
The PoC script calls initialize(), deploys the spoofed bridge, mimics a user calling depositEth() and shows the bridge balance increase. A proof of concept, or PoC, is a small program that demonstrates a vulnerability really works, rather than just arguing that it should. It is what turns a suspicion into a report a project can act on.

The image is captioned "simple attack script".

The image is captioned "our fake bridge contract".
Root cause
The chain of mistakes is worth spelling out, because each link matters:
- postUpgradeInit wipes slots 0, 1 and 2, and rewrites only bridge and allowListEnabled. It leaves sequencerInbox and the two initializer booleans empty.
- The initializer modifier therefore no longer sees the contract as initialised, because the booleans it reads are empty.
- The check that would have refused re-initialisation because bridge was already set had been removed as a gas optimisation.
Together, these turn a one-time initialisation into a repeatable one, and a repeatable initialisation lets an attacker point the bridge slot at their own contract. The existing defences, the initializer modifier and the bridge-already-set check, each failed for a separate reason: the first because its state was wiped by the upgrade path, the second because it no longer existed.
Impact
Any would-be depositor attempting to bridge funds from Ethereum to Arbitrum Nitro could have their deposit redirected to the attacker's contract. The author describes this as a multi-million dollar vulnerability, notes that the contract was accepting thousands of ETH of deposits each day, and cites a largest recorded deposit of 168,000 ETH (about $250mm) and typical 24 hour totals of about 1000 to about 5000 ETH. The attacker could take everything, take only large deposits to stay undetected, or front-run the next massive deposit by re-initialising with the malicious bridge.
Fix
The write-up does not describe the fix that was applied. The Arbitrum team provided a 400 ETH bounty, which the author thanks them for.
Variants to test
These are the general lessons, written as things to look for in other projects.
- Upgrade hooks that clear initialisation state. Look for functions such as postUpgradeInit or reinitializer routines in upgradeable proxies, and check whether every slot written by the original initializer is rewritten. A positive result is a slot that the initializer sets and the upgrade hook leaves empty, visible with cast against the proxy's storage.
- Removed guards in upgradeable contracts. Compare the current implementation against earlier versions and look for deleted checks that protected initialisation or privileged setters. A positive result is a deleted check whose absence allows a state change that the earlier version rejected.
- Public initializers on live proxies. For any TransparentUpgradeableProxy with a public initialize(), read the initializer booleans and the address slots on chain. A positive result is an empty initializer slot on a contract that is already handling user funds.
- Uninitialised address variables. Search for address state variables that are read but never set on a given deployment path. A positive result is a slot that Etherscan shows as set while direct storage reads show it empty, or the reverse.
- Deposit paths that trust a stored address. Trace functions such as depositEth() to see whether the destination is read from a mutable slot. A positive result is a deposit that can be redirected by changing that slot rather than by changing the caller.
Glossary
- Address: a unique identifier for a wallet or contract on a blockchain, written as a long string starting with 0x.
- AllowListEnabled: a setting in the contract that turns an allow list on or off; an allow list is a list of addresses permitted to do something.
- Arbitrum: a system that runs transactions off Ethereum's main chain to make them cheaper, while recording results back on Ethereum.
- Arbitrum Nitro: the name of a major Arbitrum upgrade, whose launch the author was watching.
- Block explorer: a website such as Etherscan that lets anyone look up contracts, transactions and balances on a blockchain.
- Boolean: a value that is either true or false.
- Bridge: a system that moves funds or data from one blockchain to another.
- Bug bounty: a public offer to pay a reward to anyone who finds and privately reports a flaw in a product.
- cast: a command-line tool from Foundry that can read and interact with a blockchain, including reading a contract's storage slots directly.
- Chain agnostic: not tied to one particular blockchain.
- Contract: a small program deployed on a blockchain, with functions anyone can call and storage that persists.
- Cross-chain: involving more than one blockchain, usually moving value between them.
- DelayedInbox: the Arbitrum contract on Ethereum that receives messages and deposits destined for Arbitrum.
- depositEth(): the function users call to send ETH from Ethereum into Arbitrum through the bridge.
- ETH: the currency of the Ethereum blockchain.
- Etherscan: a popular block explorer for Ethereum.
- Foundry: a set of developer tools for Ethereum, of which cast is one part.
- Front-run: to act just before someone else's pending transaction is processed, so your action takes effect first.
- Gas: the fee paid for each operation a contract performs; lower gas means cheaper transactions.
- Guard: a check in code that stops an action when conditions are wrong.
- Honeypot: a tempting pile of funds that attracts attackers.
- ImmuneFi: a website that lists bug bounty programmes.
- Implementation: in the proxy pattern, the contract that holds the actual logic, which the proxy forwards calls to.
- initialize(): the public setup function of an upgradeable contract, which fills in the first values in storage.
- Initializer modifier: a guard that runs before initialize() and rejects the call if the contract has already been initialised or is currently being initialised.
- L2: layer two, a system built on top of a main blockchain to make transactions cheaper and faster.
- Modifier: a piece of Solidity code that runs before or after a function, often used for checks.
- Optimism: another system that scales Ethereum, whose code the author had also studied.
- postUpgradeInit: a function called after an upgrade that rewrites some storage slots; in this story it wiped the initialisation state.
- Proof of concept (PoC): a small program that demonstrates a vulnerability really works.
- Protocol: a set of rules and contracts that together make a system work.
- Proxy: a contract that holds storage and forwards calls to an implementation contract, so the logic can be upgraded without moving the funds.
- Re-initialisation: running a setup function a second time, which should normally be impossible.
- Sequencer: the part of Arbitrum that orders transactions.
- sequencerInbox: the address slot in the DelayedInbox contract that records which sequencer inbox to use.
- Smart contract: see contract.
- Solidity: the programming language most Ethereum contracts are written in.
- Spoofed bridge: a fake contract that takes the place of the real bridge so that deposits go to the attacker.
- Storage slot: one numbered box in a contract's permanent memory, where a variable is kept.
- Trace log: a detailed record of every internal call a transaction made, step by step.
- TransparentUpgradeableProxy: a standard proxy pattern that lets a project upgrade a contract's logic while keeping its storage and funds in place.
- Uninitialised: not yet given a value; a storage slot that is still empty.
- Vulnerability: a flaw in software that someone could abuse to cause harm.
- Wallet: software or hardware that holds the keys to an address and lets a person send transactions.