zkLend Hack
Incident Overview
On February 12, 2025, zkLend, a lending protocol on Starknet, suffered an exploit due to a rounding error in the mint() function. The attacker manipulated the lending_accumulator to artificially inflate their balance, leading to a loss of $9.5M (3,600 ETH).
The attack exploited a rounding error in zkLend’s mint() function, where improper integer division (div(amount, accumulator)) caused downward rounding and balance inflation. By artificially increasing the lending_accumulator, the attacker repeatedly deposited and withdrew wstETH, gaining additional wei due to rounding inconsistencies. This cycle exponentially increased their holdings, allowing them to extract wstETH without proportional cost deductions.
The stolen funds were then bridged to Ethereum and laundered through Railgun, though Railgun’s protocol policies returned the funds to the attacker’s original address.
Incident Report
Protocol Information
Market Context at Time of Hack
What the Attacker Needed to Succeed
Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.
What Auditors Should Check
If you're auditing a protocol with similar architecture to zkLend, these are the critical security checks that could have prevented this incident (February 2025).
- Verify all logic paths related to Empty Market Exploit / Other are guarded by proper access controls and input validation
- Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs
Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.
Free TrialSources & References
Learn to Prevent the Next zkLend
The zkLend hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.