Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

How an Attacker Drained $128M from Balancer Through Rounding Error Exploitation

0
Medium
Exploit
Published: Wed Nov 05 2025 (11/05/2025, 12:04:59 UTC)
Source: Check Point Research

Description

By: Dikla Barda, Roaman Zaikin & Oded Vanunu On November 3, 2025, Check Point Research’s blockchain monitoring systems detected a sophisticated exploit targeting Balancer V2’s ComposableStablePool contracts. The attacker exploited arithmetic precision loss in pool invariant calculations to drain $128.64 million across six blockchain networks in under 30 minutes. The attack leveraged a rounding error […] The post How an Attacker Drained $128M from Balancer Through Rounding Error Exploitation appeared first on Check Point Research .

AI-Powered Analysis

AILast updated: 11/05/2025, 12:14:17 UTC

Technical Analysis

The Balancer V2 exploit is a sophisticated attack targeting the ComposableStablePool contracts within Balancer's decentralized finance (DeFi) protocol. Balancer V2 uses a centralized Vault contract to hold tokens and separate storage from pool logic, enabling capital efficiency but also centralizing risk. The vulnerability lies in the arithmetic precision loss during the scaling of token balances in the _upscaleArray function, which uses integer division rounding down small values (in the 8-9 wei range). This rounding causes significant relative errors—up to 10% per operation—that propagate into the calculation of the pool invariant (D), which determines the Balancer Pool Token (BPT) price. The attacker exploited this by executing a batchSwap transaction containing 65 micro-swaps that pushed token balances to critical rounding boundaries, artificially lowering the invariant and thus the BPT price. This allowed the attacker to buy BPT at suppressed prices and redeem underlying assets at full value, extracting millions in profit per pool. The attack was automated within the constructor of a deployed smart contract, which accumulated stolen funds in the Vault’s internal balance system. Subsequently, a withdrawal function transferred these funds to the attacker’s external address. The exploit affected multiple pools simultaneously and drained a combined total of approximately 6,586 WETH plus other wrapped tokens, totaling $128.64 million across six blockchain networks in under 30 minutes. The root cause is the lack of validation for invariant changes and the cumulative effect of rounding errors in batch operations, which traditional audits failed to detect. This incident underscores the risks of mathematical vulnerabilities in DeFi protocols and the necessity for continuous, adversarial security testing that considers cumulative effects of operations.

Potential Impact

The exploit resulted in a direct financial loss of approximately $128.64 million, severely impacting liquidity providers and token holders within the Balancer ecosystem. For European organizations engaged in DeFi investments, asset management, or providing services related to Balancer or similar protocols, this attack could lead to significant monetary losses and reputational damage. The shared Vault architecture means that a single vulnerability can affect multiple pools simultaneously, amplifying the impact. Additionally, the exploit undermines trust in DeFi platforms, potentially reducing user participation and investment from European markets. Regulatory scrutiny in Europe may increase following such high-profile exploits, affecting compliance requirements and operational costs for blockchain-based financial services. The attack also highlights systemic risks in smart contract design, emphasizing the need for improved security practices in European blockchain projects. Organizations relying on Balancer or similar protocols should assess exposure and consider the broader implications for their DeFi strategies and risk management frameworks.

Mitigation Recommendations

1. Patch the _upscaleArray function and related scaling operations to use higher-precision arithmetic or fixed-point math libraries that avoid rounding down errors, ensuring minimal precision loss even for small token balances. 2. Implement strict invariant validation checks after batchSwap operations to detect abnormal reductions in the pool invariant (D) and reject transactions that manipulate BPT prices. 3. Introduce limits on batchSwap transaction complexity and the number of micro-swaps allowed atomically to reduce the risk of compounded rounding errors. 4. Enhance continuous security validation frameworks to include adversarial testing and economic attack modeling that simulate cumulative effects of batch operations. 5. Audit and monitor internal balance accounting mechanisms to detect unusual accumulation patterns indicative of exploitation. 6. Encourage Balancer and similar DeFi protocols to adopt formal verification methods for critical financial calculations. 7. For European organizations, integrate blockchain transaction monitoring tools that can detect anomalous swap patterns and alert on potential exploits. 8. Educate developers and auditors on the risks of integer division and rounding errors in smart contract arithmetic, promoting best practices for precision handling. 9. Consider diversification of DeFi exposure to reduce systemic risk from single protocol vulnerabilities. 10. Collaborate with regulatory bodies to establish security standards for DeFi protocols operating within European jurisdictions.

Need more detailed analysis?Get Pro

Technical Details

Article Source
{"url":"https://research.checkpoint.com/2025/how-an-attacker-drained-128m-from-balancer-through-rounding-error-exploitation/","fetched":true,"fetchedAt":"2025-11-05T12:14:04.783Z","wordCount":1415}

Threat ID: 690b3f8ceb4434bb4f895c1c

Added to database: 11/5/2025, 12:14:04 PM

Last enriched: 11/5/2025, 12:14:17 PM

Last updated: 11/5/2025, 3:05:04 PM

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats