delegatecall hijack: how $1.46B was stolen from Bybit
In February 2025 the Bybit exchange lost about $1.46B - the largest theft in crypto history. The contract was not "broken": the multisig signers were shown a routine-looking operation, but inside it a single flag turned a transfer into a takeover of the wallet. This is an explainer of the mechanics. Up front, honestly: the vector targets smart-contract wallets and multisigs, not your ordinary EOA (burner) wallet, and the defense here is engineering, on the wallet's side. But the lesson is useful to everyone.
What delegatecall and the operation flag are
A smart-contract wallet (for example a Safe/Gnosis multisig or a proxy account) executes transactions its
owners approved. Each such transaction has an operation flag: 0 is an ordinary call
(call), 1 is delegatecall. The difference is critical: with
delegatecall the code of another contract runs in the wallet's own storage. That means
the called contract can overwrite any storage slot of the wallet - including the pointer to its
implementation (masterCopy) - and so seize control of the account.
How an operation becomes a takeover
- In the wallet UI the signers are shown a harmless action - for example an ordinary transfer.
- In the actual payload
operationis set to1(delegatecall), and the target is the attacker's contract. - On execution the attacker's contract, running as the wallet, rewrites the implementation slot (or moves assets directly). After that the attacker controls all of the account's logic, not the owners.
This differs from a hidden approve: there the attacker got a right over one asset, here they take the wallet's logic itself and control every future operation.
A Safe multisig transaction was carried out with the operation flag switched from
call to delegatecall: the attacker's code ran and swapped the wallet's logic -
and the funds left. The root cause was a front-end compromise of Safe{Wallet} (a
supply-chain attack on the interface), not a bug in the contract itself. The signers saw one thing and
signed another.
Who it affects
Directly - teams and users of smart-contract wallets and multisigs (Safe and similar) who sign
execTransaction. An ordinary EOA wallet does not sign such transactions, so as a beginner you
are unlikely to meet this vector in person. But it is the mechanics of the largest theft in history, and the
general lesson from it concerns everyone.
How the defense works
- Flag delegatecall to an untrusted target. The wallet policy flags/rejects any
operation = delegatecallto an address that is not on an allow-list of audited libraries. - Implementation-slot invariant. The implementation pointer (and other critical slots) must stay unchanged after a normal user transaction; a post-execution check reverts the transaction if the slot moved.
- Transaction guard. A transaction guard rejects
delegatecallto addresses off the allow-list - the takeover path becomes unreachable. This is the canonical post-Bybit defense.
The general lesson for everyone
Even if you never touch multisigs, take the key point away: what the interface shows is not always equal to what will execute on-chain, and an app's front-end can be compromised. Hence the same habits as against signature phishing: don't sign blind, verify the details of the operation, and with large amounts be extra careful and, where possible, independently check what will actually execute.
Want to practice the "read what you sign" skill on safe examples? In our testnet trainer you break down signatures and transactions and learn to notice when what is shown diverges from the substance.