首先,我向 @Balancer 团队以及所有受此攻击影响的人致以最深切的同情。
每当发生像这样的重大 DeFi 攻击,尤其是出自老牌协议时,都是加密行业最痛苦的日子之一。被盗资金的损失远不止于美元价值,更严重的是,它损害了整个 Crypto 和 DeFi 生态的信誉,让行业整体倒退了好几个月。
First and foremost, my greatest sympathies to the @Balancer team as well as everyone affected by this exploit.
It's always a rough day when there's a significant DeFi hack like this, let alone from an OG protocol. More than the dollar cost of the stolen funds, this genuinely hurts all of crypto and DeFi's image as a whole and sets our industry back several months.
Fact of the matter is that Solidity is just too insecure a language for it to truly be the one that hosts the future of finance. Solidity has just too large of a surface area that makes it prone to hacks, with devs relying on manual checks for everything from access controls to precise math, and it is exactly why asset-first languages like Move were invented to begin with.
After doing a bit of digging, this was how Balancer was hacked: Attackers exploited rounding errors in stable pool swaps to distort the pool's invariant, a key math constant that represents balanced liquidity. They started with flash-loaned swaps of BPT (Balancer Pool Tokens) for an underlying asset like cbETH, pushing balances to exact rounding boundaries (e.g., scaled to 9). Then, they swapped between assets like wstETH to cbETH with crafted amounts (e.g., ~8.918 rounded down to 8 due to fixed-point scaling), underestimating reserve changes and artificially deflating the invariant (D).
This tanked the BPT price (D / totalSupply), letting attackers reverse-swap to mint excess BPT cheaply, burn it to withdraw underlying assets at "normal" rates, and pocket the difference, essentially stealing from liquidity providers. Profits accumulated in the Vault's internal balances and were cashed out via manageUserBalance with WITHDRAW_INTERNAL, no direct auth bypass needed since the math flaw subsidized the theft. It's a precision loss in Solidity's manual fixed-point libraries that cascades into massive drains.
The way Move would have bypassed this hack altogether is by baking in safety at the core: Assets are treated as resources with linear types that enforce strict conservation (no unintended dupes, drops, or losses), and math uses exact u64/u128 integers with built-in overflow aborts, no floats, no exploitable rounding slips in complex calculations.
In a Move-based DEX, swap functions would atomically check and update invariants via the VM, aborting on any imbalance, such as:
public entry fun swap(pool: &mut LiquidityPool, in: Coin, out_amt: u64): Coin {
assert!(coin::value(&in) >= calculate_required_in(pool, out_amt), E_INSUFFICIENT_INPUT);
coin::merge(&mut pool.coin_x_reserve, in);
let out = coin::extract(&mut pool.coin_y_reserve, out_amt);
assert!(check_invariant(pool), E_INVARIANT_VIOLATION);
out
}
Plus, atomic transactions kill reentrancy risks. This is why Move ecosystems have far fewer exploits compared to the EVM.
It's time for DeFi builders to embrace languages like Move that prioritize security from the ground up, so we can finally build a resilient financial future without preventable setbacks like this.
事实是,Solidity 这门语言本身就过于不安全,不足以承担未来金融体系的使命。它的攻击面太大,开发者必须依赖手动检查来确保从权限控制到精密计算等各环节的安全。这正是「资产优先」语言 Move 诞生的原因。
经过分析,Balancer 的漏洞原理如下:
攻击者利用了稳定池(stable pool)兑换中的舍入误差(rounding error),扭曲了代表流动性平衡的核心数学常数 D (不变量)。
他们先用闪电贷把 BPT(Balancer 池代币)换成 cbETH 等底层资产,把余额推到精确的舍入边界(例如 9 位小数)。接着以精心设计的兑换数量(例如 8.918 在定点缩放下被向下舍入为 8)在 wstETH 与 cbETH 间反复交换,低估储备变动,从而人为降低 D 值。
这导致 BPT 价格暴跌(D / totalSupply),让攻击者能低价增发多余 BPT,再销毁以“正常汇率”提取底层资产,套取差价,最终窃取流动性提供者的资金。利润累积在金库的内部余额中,通过 manageUserBalance 和 WITHDRAW_INTERNAL 参数提走,无需绕过权限验证,漏洞本身就提供了套利空间。
而 Move 可以从根本上防止这类漏洞。
它把资产当作具有线性类型的资源,强制保持严格守恒(不能重复、丢失或凭空出现);
它的数学运算采用 u64/u128 精确整数,并内置溢出保护,不使用浮点数,因此不会出现舍入误差。
在 Move 驱动的 DEX 中,Swap 函数会在 VM 层原子性地校验并更新不变量,若不平衡则自动中止。同时,原子交易(atomic transactions)从机制上消除了重入攻击风险。
这就是为什么 Move 生态相比 EVM 生态,安全事件更少、漏洞更难出现。
现在是 DeFi 开发者拥抱 Move 等底层安全语言的时候了。唯有从语言层面保障安全,我们才能构建真正稳健、可持续的金融未来。
4,01 K
1
Conținutul de pe această pagină este furnizat de terți. Dacă nu se menționează altfel, OKX nu este autorul articolului citat și nu revendică niciun drept intelectual pentru materiale. Conținutul este furnizat doar pentru informare și nu reprezintă opinia OKX. Nu este furnizat pentru a fi o susținere de nicio natură și nu trebuie să fie considerat un sfat de investiție sau o solicitare de a cumpăra sau vinde active digitale. În măsura în care AI-ul de generare este utilizat pentru a furniza rezumate sau alte informații, astfel de conținut generat de AI poate să fie inexact sau neconsecvent. Citiți articolul asociat pentru mai multe detalii și informații. OKX nu răspunde pentru conținutul găzduit pe pagini terțe. Deținerile de active digitale, inclusiv criptomonedele stabile și NFT-urile, prezintă un grad ridicat de risc și pot fluctua semnificativ. Trebuie să analizați cu atenție dacă tranzacționarea sau deținerea de active digitale este adecvată pentru dumneavoastră prin prisma situației dumneavoastră financiare.


