On July 25, 2023, the decentralized lending protocol EraLend, operating on the zkSync Era Layer 2 network, fell victim to a sophisticated read-only reentrancy attack that resulted in the loss of approximately $3.4 million worth of cryptocurrency. The exploit, flagged by blockchain security firm CertiK, represents one of the more technically complex DeFi attacks seen in a month already plagued by flash loan exploits and smart contract vulnerabilities across the broader ecosystem.
The Exploit Mechanics
The attack centered on a read-only reentrancy vulnerability within the Syncswap pair contract, which EraLend relied upon as a price oracle dependency. According to CertiK’s incident analysis, the attacker—operating from externally owned address (EOA) 0xf1D07—executed a flash loan attack that manipulated EraLend’s price oracle through a carefully constructed sequence of calls. The core mechanism involved burning tokens and triggering a callback function before the _updateReserves function completed execution. This timing exploit caused the oracle to calculate asset prices based on incorrect reserve data, allowing the attacker to extract funds at artificially favorable rates.
Read-only reentrancy attacks differ from standard reentrancy exploits in that they manipulate view functions rather than state-changing functions. The vulnerability exists when a contract reads state during an ongoing transaction that has not yet finalized, creating a window where seemingly accurate data is actually stale or manipulated. In EraLend’s case, the Syncswap pair’s failure to implement proper reentrancy guards on its callback mechanisms left the oracle exposed to this precise type of manipulation.
Affected Systems
EraLend functioned as the largest lending protocol on the zkSync Era network at the time of the exploit. The protocol allowed users to deposit cryptocurrency as collateral and borrow against it, relying on Syncswap’s liquidity pools to determine real-time asset prices. When the oracle was compromised, the attacker was able to borrow significantly more assets than their collateral should have permitted. The stolen funds, primarily in USDC, were rapidly moved across multiple networks. CertiK traced the assets to several EOAs controlled by the exploiter, with the majority consolidated into four wallets on the Ethereum mainnet, and additional funds dispersed to addresses on Arbitrum and Optimism.
The zkSync Era network itself was not compromised—only the EraLend protocol’s specific implementation of oracle-dependent lending logic was affected. However, the incident raised broader questions about the security of DeFi protocols building on newer Layer 2 networks, where the maturity of smart contract auditing and battle-testing remains limited compared to Ethereum mainnet deployments.
The Mitigation Strategy
The EraLend team responded quickly to contain the breach. In an official statement, the team confirmed that the attack had been contained and that the threat actor was no longer able to continue exploiting the vulnerability. Users were strongly advised against depositing USDC into EraLend while the investigation was ongoing. The protocol likely paused affected lending pools and implemented emergency measures to prevent further drainage of remaining liquidity.
From a defensive perspective, read-only reentrancy vulnerabilities can be prevented through several approaches. Protocols should implement reentrancy guards not only on state-changing functions but also on view functions that feed into critical price calculations. Using time-weighted average price (TWAP) oracles rather than spot price oracles reduces the attack surface, as TWAP calculations smooth out momentary price distortions. Additionally, adopting multi-oracle architectures that cross-reference prices from multiple independent sources makes it significantly more difficult for an attacker to manipulate the price feed through a single vulnerability.
Lessons Learned
The EraLend exploit is the second largest reentrancy attack that CertiK flagged during July 2023, a month that saw a combined total of $6.4 million lost to reentrancy attacks alone. More broadly, the DeFi ecosystem experienced 128 flash loan attacks in the first seven months of 2023, resulting in cumulative losses of $255 million. These statistics underscore a persistent challenge in decentralized finance: even well-understood vulnerability classes like reentrancy continue to find new attack vectors as protocols compose complex logic across interconnected smart contracts.
The incident also highlights the particular risks facing protocols on newer Layer 2 networks. While zkSync Era offers significant scalability advantages, the ecosystem of audited, battle-tested protocols remains smaller than on Ethereum mainnet. Projects building on L2 networks must invest in comprehensive security audits that specifically test for cross-contract reentrancy scenarios, oracle manipulation vectors, and composability risks that emerge from interacting with other protocols on the same chain.
User Action Required
Users who had funds deposited in EraLend at the time of the exploit should monitor official EraLend communication channels for updates on fund recovery and compensation plans. All DeFi users, regardless of platform, should consider the following security practices: diversify deposits across multiple protocols to limit exposure to any single exploit, prefer protocols that have undergone multiple independent security audits, and stay informed about security incidents affecting the chains and protocols where their funds are deployed. With Bitcoin trading around $29,227 and Ethereum at $1,858 at the time of this incident, the broader market conditions remained stable—but individual protocol risks can result in significant losses regardless of overall market direction.
Disclaimer: This article is for informational purposes only and does not constitute financial or investment advice. Always conduct your own research before engaging with any DeFi protocol.
read-only reentrancy since the DAO hack in 2016 and protocols still get wrecked by it in 2023. the Syncswap oracle dependency was the real red flag here
read-only reentrancy has been documented since 2016 and auditors still miss it. the issue is that read-only calls dont trigger reentrancy guards so standard checks are useless
the DAO hack was a write reentrancy though. read-only is sneakier because it doesnt trigger any modifier guards. auditors still miss these
every audit says reentrancy guards are in place but read-only bypasses all standard checks. the class is well known but hard to detect
read-only reentrancy has literally been a known attack vector since 2016. at what point do we stop blaming auditors and start blaming protocol design
$3.4M from a timing exploit on _updateReserves. the attacker literally beat the reserve update to the punch. classic race condition dressed up as DeFi innovation
^ yep. EOA 0xf1D07 is now marked on every blocklist but the funds were probably mixed through tornado before CertiK even published the analysis
the real lesson here is never trust a single oracle source. Syncswap was the only price feed and that one dependency cost $3.4M
single oracle dependency in 2023 is negligent. chainlink exists, tellor exists, using one untested feed for price data is asking to get wrecked
chainlink and tellor both existed in july 2023. eraLend using syncswap as the sole oracle for a lending market was pure negligence not a tech limitation
the Syncswap dependency was the actual crime here. one oracle for a lending market is just gambling with other peoples money
3.4M is honestly small change for zkSync era given how much TVL was flowing through it. could have been way worse if the attacker was patient