What Happened

zkLend — 2025 Backtest

$9.5M|Smart Contract Exploit|February 12, 2025

Attacker exploited floor division rounding in safe_decimal_math library when withdrawing from a wstETH market. By first inflating the lending_accumulator via a flash loan donation to the empty pool, each subsequent withdrawal burned only 1 zToken while receiving disproportionate underlying assets. $9.5M drained across multiple transactions.

What Hindenrank Would Have Said

As of January 1, 2025

C-
Risk Score
52/100

zkLend rates C- as of January 2025. The protocol is well-audited but the EraLend incident (July 2023) established a known exploit class for ZK-rollup lending protocols using accumulator-based interest models. Neither audit specifically checked for empty-market accumulator inflation attacks. The C- grade reflects elevated-but-not-critical risk — the protocol would need a targeted exploit to be compromised.

Mechanism Novelty11/15
Interaction Severity15/20
Oracle Surface6/10
Documentation Quality7/10
Track Record2/15
Scale Exposure3/10
Regulatory Risk2/10
Protocol Vitality6/10

Scenario Predicted the Failure Mode

The C- grade (52/100) did not cross the D+ threshold for a high-risk flag. However, our collapse scenario analysis predicted the exact failure mode that occurred.

Flagged by dimensions: Mechanism Novelty, Interaction Severity, Oracle Surface, Documentation Quality

One or more collapse scenarios directly matched the actual failure mode.

Top Risks Identified

  1. 1.Cairo VM integer arithmetic uses floor division in safe_decimal_math — precision loss in accumulator math not flagged by any audit
  2. 2.EraLend (July 2023) was exploited via the same accumulator + flash loan + rounding combination on zkSync; similar design present in zkLend
  3. 3.Dual oracle system (Chainlink + Pragma) with undocumented staleness checks and fallback logic
  4. 4.Team holds full admin control with no timelock or DAO governance implemented yet
  5. 5.Empty market initialization creates attack surface for accumulator inflation attacks

Collapse Scenarios

Empty Market Accumulator Inflation Attack

Moderate
Trigger

Attacker identifies a newly-listed or low-liquidity asset market where the lending_accumulator can be inflated via flash loan donation, then exploits safe_decimal_math floor division to withdraw more than deposited.

Cascade
1.
Attacker flash-borrows a large amount of the target assetAttacker has sufficient capital to seed the empty market and make the donation that inflates the accumulator
2.
Attacker deposits a small amount, inflates lending_accumulator by donating to the poollending_accumulator value becomes extremely large; safe_decimal_math floor division now rounds down withdrawal amounts to nearly zero zTokens burned
3.
Attacker repeats deposit-withdraw cycle, each time withdrawing more than depositedPool is drained across multiple iterations; other depositors lose their funds
4.
Attack repeats across other low-liquidity markets before protocol can pauseMulti-asset drain; protocol pauses deposits/withdrawals; ZEND token crashes; TVL collapses
Historical Precedent

EraLend (July 25, 2023, zkSync): Attacker used read-only reentrancy to manipulate reserve values and exploit rounding in the accumulator model, draining $3.4M. The same attacker cluster would later target zkLend.

Oracle Failure During StarkNet Network Stress

Moderate
Trigger

StarkNet experiences network congestion or outage during a volatile market period; Pragma oracle updates lag significantly behind real prices; undercollateralized positions build up before liquidators can act.

Cascade
1.
StarkNet experiences high congestion during a crypto market volatility eventPragma oracle updates delayed; Chainlink fallback may not be configured for all assets
2.
Stale oracle prices allow new borrowing at favorable rates not reflecting real market pricesUndercollateralized positions open without triggering health factor alerts
3.
Oracle eventually updates to correct prices; mass liquidations triggered simultaneouslyLiquidation demand exceeds available liquidator capital; some positions become bad debt
4.
Bad debt accumulates; protocol faces insolvency on affected assetsDepositors in affected pools lose partial funds; ZEND governance token crashes; TVL flight
Historical Precedent

Multiple lending protocols experienced oracle failures during high volatility (e.g., Compound USDC oracle manipulation in 2021 causing $89M in liquidations). StarkNet's novel architecture may have higher oracle latency risks than Ethereum mainnet.

See how today's protocols score

The same 8-dimension rubric applied to 672+ live protocols.