Back to Blog
2025 Year in Review December 2025 15 min read

2025 Web3 Security Report: $3.4B Lost, and What the Industry Got Wrong

2025 will be remembered for a disturbing paradox: fewer hacks, catastrophic losses. The industry has shifted from small skirmishes to high-stakes, targeted exploitation.

The median amount stolen per incident dropped 36% year-over-year to around $104,000. Opportunistic attacks are becoming less profitable. Standard defenses are working.

But the average loss per hack surged 67% to over $5.3 million. Total stolen funds exceeded $3.4 billion.

The industry has shifted from a spray of small skirmishes to high-stakes, targeted exploitation. Attackers are concentrating resources on fewer, higher-value targets, and the defenses aren't keeping up.

By The Numbers

Metric 2024 2025 Change
Total Stolen ~$1.98B >$3.41B +72%
Average Loss/Hack ~$3.2M ~$5.32M +67%
Median Loss/Hack ~$161K ~$104K -36%
Top Attack Vector Smart Contract Bugs Logic Errors / Arithmetic Flaws

The data tells a clear story: traditional code audits catch a lot, but they're not enough on their own. Complex logic errors, precision arithmetic flaws, and library vulnerabilities are slipping through the gaps. We need more.

The Balancer V2 Exploit: $128 Million and the "120M Gap"

While Bybit highlighted centralized operational failures, Balancer exposed something more insidious in DeFi: the "120M Gap."

This is the massive financial damage that can accumulate from minute, cumulative logical errors in smart contracts, errors that slip through when code changes after an audit is completed.

On November 3, 2025, Balancer V2's Composable Stable Pools lost $128 million. Not to a reentrancy attack. Not to an access control failure. To rounding errors.

The Technical Root Cause

In the EVM, integer division truncates. When Balancer V2 pools normalize tokens with different decimal precisions (USDC has 6, DAI has 18), they use scaling factors.

The attacker discovered that by executing massive sequences of batch swaps—many swaps in a single transaction, they could exploit the tiny rounding discrepancy in each micro-calculation.

A single rounding error might cost 0.000001 cents. Repeat it tens of thousands of times within a flash-loan-funded transaction, and you create a significant divergence between the pool's actual balance and its internal accounting.

Once the accounting was distorted, the attacker withdrew liquidity at a steep discount. $128 million gone.

The Audit Failure

Balancer is one of the most audited protocols in DeFi. It had undergone 11 separate security audits since 2021.

None of them caught this.

Why? The vulnerable code wasn't there when they looked. The ComposableStablePool with its overridden _scalingFactors function was added ten days after the final audit concluded. It was deployed to production, sat dormant for years, and was never reviewed.

This is the essence of the 120M Gap. We wrote about this incident in detail, including how SafeStackAI's system detected all five critical components of the vulnerability: non-unitary scaling factors, unidirectional rounding, small amount exploitation, batch swap chains, and the absence of minimum swap sizes.

An auditor could have caught this vulnerability, perhaps yes. But no auditor ever saw the code. That's the gap. Manual audits are essential, and pattern matching tools add another layer, but neither helps when new code ships without review. Closing this gap requires continuous analysis that catches vulnerabilities whenever code changes, not just at scheduled audit checkpoints.

The Cetus Protocol Incident: $223 Million and the Move Language Myth

2025 also challenged the assumption that newer, "safer" programming languages eliminate exploits.

Sui's Move language was designed with resource safety and formal verification in mind. Cetus, the largest DEX on Sui, still lost $223 million.

The Bit-Shifting Vulnerability

The vulnerability existed in a function called checked_shlw (checked shift left with word) within the integer-mate library, an open-source math library used by Cetus.

This function performs a bitwise left shift while checking for overflows. The implementation was supposed to cap values to prevent them from exceeding 256-bit storage capacity after the shift.

The check was mathematically incorrect. It allowed specific edge-case values to pass despite being large enough to cause an overflow when shifted.

The Exploit Path

  1. Attacker takes a flash loan in SUI
  2. Opens a concentrated liquidity position with an extremely narrow tick range
  3. Inputs a crafted liquidity amount that passes the flawed check but triggers an overflow during calculation
  4. The overflow causes the protocol to calculate the required deposit as 1 token while crediting a massive liquidity position worth millions
  5. Attacker withdraws the "phantom" liquidity, draining real assets

The Supply Chain Risk

This wasn't a bug in Cetus's own code. It was in a third-party math library that Cetus imported.

In DeFi, supply chain vulnerability isn't limited to npm packages or centralized software. Smart contracts rely on shared libraries for common operations. If a library contains a bug, every protocol importing it is vulnerable.

The integer-mate flaw endangered the entire Sui ecosystem, not just Cetus.

Recurring Failures: Logic Errors and Missing Assertions

Two other incidents from 2025 illustrate recurring patterns worth understanding.

Abracadabra Money: The "Cook" Function Exploit

Abracadabra lost $13 million in March and another $1.8 million in October 2025. The October hack is particularly instructive.

The protocol used a cook() function to batch multiple actions (borrow, repay, swap) into a single transaction.

The attacker exploited a logic flaw where they could manipulate a needsSolvencyCheck variable. Normally, borrowing MIM sets this flag to true, forcing a collateralization check at transaction end.

By calling a specific sequence, borrow (setting flag to true), then a "virtual hook" action, the attacker hit an else block that reset protocol state, flipping needsSolvencyCheck back to false.

The transaction concluded without the solvency check running. The attacker borrowed funds without collateral.

This is a classic state inconsistency bug. It requires tracing the state of a variable through multiple nested function calls and loops. This is exactly what Call Flow Analysis is designed to detect complete execution paths where critical security flags can be disabled by subsequent actions.

Typus Finance: The Missing Assert

In October 2025, Typus Finance lost $3.4 million due to a trivial oversight: a missing assert statement.

The update_v2 function in their oracle checked if the caller was an authorized admin:

vector::contains(&update_authority.authority, ...)

The code called the check. It ignored the return value. There was no assert! or if statement to halt execution when the check returned false.

Any user could call the function. The check would run, return false silently, and the code would proceed to update the price. The attacker set an asset price to $1 and drained the pool.

The Off-Chain Crisis

2025 saw a surge in attacks targeting components outside smart contracts: front-end interfaces, developer tools, and operational infrastructure.

The "Qix" npm Poisoning: In September, a prolific maintainer of npm packages (like chalk and debug) was phished. Attackers published malicious versions of widely-used libraries. dApps that updated dependencies inadvertently pulled malicious code that replaced legitimate transaction payloads with drainer transactions when users signed.

The Garden Finance "Solver" Hack: Garden Finance lost $11 million not through a contract bug, but through compromise of its off-chain "solver" network, agents that facilitate cross-chain swaps. The attacker manipulated exchange rates during bridging.

These incidents reinforce that security audits must extend beyond the blockchain to the entire infrastructure stack.

What 2025 Taught Us

Looking across these incidents, patterns emerge:

1. Traditional audits are necessary but insufficient

Balancer had 11 audits. The vulnerability was introduced 10 days after the final audit concluded. Point-in-time snapshots can't catch what happens after they're completed.

2. Complexity defeats human review

The interaction effects between composable DeFi protocols exceed human capacity to simulate. Batch operations, flash loans, and cross-contract state changes create execution paths that are invisible to line-by-line review.

3. Newer languages don't eliminate risk

Move was supposed to be safer. The Cetus exploit came from a library function that passed the type system while containing incorrect math. Language safety features are necessary but not sufficient.

4. Supply chain risk is systemic

A bug in a shared library can endanger an entire ecosystem. Protocols importing third-party code inherit its vulnerabilities. The integer-mate flaw didn't just affect Cetus, it put every Sui protocol using that library at risk.

5. Small errors compound into massive losses

The Balancer exploit wasn't a single catastrophic bug. It was a tiny rounding discrepancy, repeated thousands of times. The 120M Gap exists because human reviewers can't simulate cumulative effects at scale.

The Path Forward

The data is clear: the security paradigm that worked for the last decade is breaking down.

Manual audits remain essential. They catch the obvious bugs and provide expert judgment on design decisions. But they're slow, expensive, and unable to scale with the complexity of modern protocols.

What's needed is continuous security assurance that operates at the speed of development:

  • Pre-deployment verification that catches arithmetic safety issues, gas optimizations that compromise security, and configuration errors before code hits mainnet.
  • Call flow analysis that traces execution paths across contracts, identifying state inconsistencies and logic errors that emerge only when specific functions are called in sequence.
  • Invariant testing that fuzzes functions with edge-case inputs, catching math library bugs like the one that took down Cetus.
  • Dependency scanning that analyzes the full import tree, not just primary contract code.

The goal isn't to replace human auditors. It's to extend human capabilities with automated analysis that can keep pace with continuous development.

Looking Ahead

2026 will bring new L2s, new DeFi primitives, and new attack vectors. The complexity of composable protocols will continue to outpace manual review capacity.

The protocols that survive will be those that treat security as a continuous process, not a box to check before launch.

Ready for Continuous Security?

SafeStackAI provides continuous AI-powered security analysis for smart contracts. See how our system would analyze your protocol.