Velocore exploit: effective fees above 100%
The June 2024 attack on Velocore V2 combined a missing caller restriction with faulty fee arithmetic in constant product pools on Linea and zkSync Era. Manipulated effective fees above 100% triggered withdrawal underflow, inflating liquidity provider (LP) token accounting and allowing pool assets to be drained.
How the Linea attack progressed
Stuart's July 4, 2024 postmortem for Zokyo reconstructs the attack against the USDC-ETH pool on Linea. The vault settled asset movements, while the pool calculated amounts and maintained fee state.
| Stage | Pool or vault action | Effect in the reconstruction |
|---|---|---|
| Direct pool calls |
The attacker called
velocore__execute()
outside the vault.
|
The missing vault-only caller check exposed fee-state changes. |
| Fee manipulation |
Repeated crafted calls increased
feeMultiplier
.
|
The timestamp-dependent effective fee could exceed 100%. |
| Withdrawal operations | Three crafted operations requested USDC and ETH withdrawals through the vault. | They accumulated asset movements before the final LP calculation. |
| Final single-token withdrawal | A small USDC withdrawal encountered the manipulated fee state. | Unchecked arithmetic produced an excessive LP-token amount. |
| Vault settlement | The completed execution transferred assets to the attacker. | Zokyo reports about 155 ETH and more than 500 000 USDC lost from this pool. |
Why the withdrawal arithmetic failed
The multiplier applied when
lastWithdrawTimestamp
equalled
block.timestamp
. In the affected fee-growth calculation, a sufficiently inflated fee made the deducted term larger than its starting value. Inside an
unchecked
block, that subtraction wrapped to a large unsigned value instead of stopping execution.
The corrupted result fed into LP-token accounting. The excessive LP amount came from that calculation; it did not represent a matching contribution of new liquidity.
Flash loans and the reported loss
DefiLlama's V2 incident record describes a flash loan that shrank the pool before LP-token underflow. Zokyo's reconstruction states that no flash loan from an external protocol was needed for the demonstrated Linea attack.
DefiLlama records approximately $6.8 million lost across V2 pools on Linea and zkSync Era. That aggregate is separate from the single USDC-ETH pool result in the reconstruction. Bittime's June 3, 2024 report described stable pools as unaffected by that attack.
last updated