Inverse Finance被盗1450万美元事件分析

CertikPublicado a 2022-04-03Actualizado a 2022-04-03

Resumen

该事件发生的根本原因在于外部价格预言机依赖导致价格被操纵,因此攻击者可通过操纵价格来借用资产。

北京时间2022年4月2日19时,CertiK安全技术团队监测到Inverse Finance被恶意利用,导致价值约1450万美元的资产受到损失。
该事件发生的根本原因在于外部价格预言机依赖导致价格被操纵,因此攻击者可通过操纵价格来借用资产。
攻击流程
在发起攻击之前,攻击者做了如下准备: 
1. 首先,攻击者部署了一个恶意合约。该合约地址为:0xea0c959bbb7476ddd6cd4204bdee82b790aa1562
2. 其次,攻击者在SushiSwap/Curve.fi中进行调换,以操纵交易中的价格,该交易地址为:0x20a6dcff06a791a7f8be9f423053ce8caee3f9eecc31df32445fc98d4ccd8365
由于SushiSwap:INV(INV-ETH Pair)的流动性非常低,用300ETH(价值约一百多万美元)换取INV将大幅增加INV价格。
随后,攻击者正式发起攻击:
1. 攻击者把在准备阶段获得的INV存入,并铸造(mint)了1746枚XINV代币。
2. XINV的价格计算:根据SushiSwap:INV对中的INV价格所计算。如上所述,INV的价格被操纵,因此每XINV的价值为20926美元。
3. 随着XINV的价格被修改,攻击者能够用铸造的XINV代币借用到如下资产:1588枚ETH,94枚WBTC,3999669枚DOLA与39枚YFI。
合约漏洞分析
该漏洞主要原因是对价格预言机具有依赖性,并且这中间有30分钟的窗口期。而攻击在准备阶段完成后正式发生,仅仅用了15秒。

预言机

在这种情况下,因为timeElapsed == 15,预言机合约Keep3rV2Oracle的函数_update()中'timeElapsed > periodSize'的检查将被绕过。这意味着最后的累积价格还没有被更新。由此可见,函数_computeAmountOut()中的amoutOut会比预期的数额大,因为priceCumulative已经被操纵了,但_observation.priceCumulative没有被更新。

预言机

一方面,XINV的价格依赖于SushiSwap:INV 对(INV-ETH对)的储备,其流动性非常低。
另一方面,TWAP可以防止闪电贷攻击。理论上,攻击者能够通过 "牺牲 "一些钱来操纵价格,也就是说,用他自己的钱来改变价格。在这个特殊的价格预言机设计中,如果经过的时间没有超过30分钟,当前的价格(来自储备金)不应该被用来计算出金金额。
资产追踪
据CertiK SkyTrace显示,价值约1450万美元的资产被盗后已被转移到Tornado Cash。

预言机

其他细节
利用漏洞进行交易的准备期间: 
https://etherscan.io/tx/0x20a6dcff06a791a7f8be9f423053ce8caee3f9eecc31df32445fc98d4ccd8365
利用漏洞进行交易发起攻击: 
https://etherscan.io/tx/0x600373f6752132https://etherscan.io/tx/0x600373f67521324c8068cfd025f121a0843d57ec813411661b07edc5ff781842
攻击者地址1:https://etherscan.io/address/0x117c0391b3483e32aa665b5ecb2cc539669ea7e9
攻击者地址2: https://etherscan.io/address/0x8b4c1083cd6aef062298e1fa900df9832c8351b3
攻击合约: 
https://etherscan.io/address/0xea0c959bbb7476ddd6cd4204bdee82b790aa1562
预言机合约: 
https://etherscan.io/address/0x39b1df026010b5aea781f90542ee19e900f2db15#code
SushiSwap INV-ETH Pair: 
https://etherscan.io/address/0x328dfd0139e26cb0fef7b0742b49b0fe4325f821
XINV 合约地址: https://etherscan.io/address/0x1637e4e9941d55703a7a5e7807d6ada3f7dcd61b#code
Keep3rV2 预言机合约地址: 
https://etherscan.io/address/0x39b1df026010b5aea781f90542ee19e900f2db15#code
​写在最后
现如今,很多项目都会用到预言机,部分项目还会对其具有很强的依赖性。安全审计,会审查预言机的设计合理性、价格算法以及经济模型等。
因此,CertiK的安全专家建议:尽量避免使用流动性低的池子作为价格预言机价格来源,同时对项目进行安全审计从而保证预言机模型的正确性。

Lecturas Relacionadas

Why P2P and Exchangers Are Becoming Obsolete, and What Will Replace Them

Titled "Why P2P and Exchanges Are Becoming Obsolete, and What Will Replace Them," this article discusses the evolution of stablecoins, particularly USDT, from a trading tool to a global payment method. However, converting crypto back to fiat for daily expenses remains a challenge. The process of using P2P platforms or crypto exchanges has become increasingly risky and complex due to stricter banking anti-fraud measures, new legislation in Russia, and rampant fraud schemes like "triangles," where sellers can inadvertently receive stolen funds. The article highlights that while P2P was convenient, banks now scrutinize frequent peer-to-peer transfers, often freezing accounts. Exchanges also pose risks like unfavorable rates and unclear compliance. The market is therefore shifting towards integrated services that eliminate the manual conversion step. It cites OneSix as an example—a crypto wallet accessible via Telegram and web that embeds currency conversion directly into payment and withdrawal scenarios. Users can pay bills or send money as if using a bank app, with the crypto-to-fiat exchange happening seamlessly in the background. It also offers invoicing for freelancers and conducts AML checks, returning suspicious transactions instantly instead of freezing them. In conclusion, as crypto integrates into everyday finance, the demand for manual, risky exchange methods is declining. The future lies in unified platforms that combine storage, compliance, conversion, and payments into a single, secure user experience.

cryptonews.ruHace 14 min(s)

Why P2P and Exchangers Are Becoming Obsolete, and What Will Replace Them

cryptonews.ruHace 14 min(s)

The CEO of MARA Holdings Compares AI Operations to Bitcoin Mining! Which is More Profitable?

Fred Thiel, CEO of MARA Holdings (a major Bitcoin mining company), states that the rapid growth of the artificial intelligence (AI) sector is transforming mining companies' business models. He claims that powering data centers for AI is significantly more profitable than Bitcoin mining. In a recent interview, Thiel explained why many mining firms are diversifying into AI infrastructure. According to Thiel, the energy demands of data centers are surging, especially due to the spread of generative AI applications. This creates new revenue opportunities for Bitcoin mining companies with robust power infrastructure. MARA Holdings is among those monitoring this shift and aims to develop its energy and infrastructure services for AI data centers. Thiel emphasized that this move toward AI does not mean the end of Bitcoin mining. He stated that Bitcoin mining remains a sustainable business model, especially for miners in regions with low electricity costs, and it is still a crucial field for utilizing excess or idle power capacity. In recent years, many Bitcoin mining companies have begun using their energy-intensive infrastructure not just for block production but also for high-performance computing (HPC) and AI applications. This strategy aims to diversify revenue sources and increase resilience against cryptocurrency market volatility. Analysts note that the growing energy demand in the AI sector presents significant transformation opportunities for mining companies. The need for high-power, uninterrupted electricity supply, particularly for large data centers, gives Bitcoin miners with existing energy infrastructure expertise a considerable advantage.

cryptonews.ruHace 25 min(s)

The CEO of MARA Holdings Compares AI Operations to Bitcoin Mining! Which is More Profitable?

cryptonews.ruHace 25 min(s)

Ratio's CEO Says Multi-Currency Stablecoins Could Eliminate Costly FX Conversions in Asia

The CEO of Ratio, John Cho, argues that multi-currency stablecoins could save Asia billions by eliminating costly foreign exchange conversions in regional trade. While USD stablecoins like USDT and USDC work for global settlements, local Asian trade is conducted in local currencies like the Korean won or Singapore dollar. Forcing these transactions through USD intermediaries creates unnecessary costs and currency risk. Cho envisions a complementary ecosystem where local-currency stablecoins work alongside USD stablecoins, enabling seamless cross-border settlements without conversion friction. A key pain point in traditional banking is the need for pre-funded Nostro and Vostro accounts, which lock up vast amounts of working capital. Blockchain-based settlement layers like Ratio offer a 24/7 alternative, using on-chain liquidity to enable instant execution even when traditional channels are closed. Modern Web3 infrastructure providers are focusing on pragmatic integration with existing corporate systems like ERPs, allowing businesses to gradually shift volumes to digital channels for better speed, cost, and reduced slippage. Clear regulation is cited as the critical catalyst for widespread institutional adoption. As jurisdictions like the U.S. advance legislation (e.g., the CLARITY Act) and Asian countries are expected to pass their own stablecoin laws within 12-24 months, regulatory uncertainty is receding. The ultimate vision is for regulated stablecoins to become an invisible settlement layer integrated into national payment systems, where payments simply happen on-chain, erasing the boundary between traditional banking and digital assets.

cryptonews.ruHace 44 min(s)

Ratio's CEO Says Multi-Currency Stablecoins Could Eliminate Costly FX Conversions in Asia

cryptonews.ruHace 44 min(s)

Huang Xiaoming, Li Bin, Lei Jun, Liang Wenfeng... Who Are the Biggest Winners in the CXMT IPO Feast?

Changxin Technology, a leading Chinese memory chip manufacturer, successfully listed on the Shanghai Stock Exchange's STAR Market (科创板) on July 8, 2026. Its share price surged from the IPO price of 8.66 yuan to close at 49 yuan on the first day, catapulting its market capitalization to 3.28 trillion yuan, making it the most valuable A-share company and triggering a massive wealth creation event. The biggest winners were the company's founder, Zhu Yiming, and its employees. Zhu Yiming's family wealth skyrocketed nearly 300% to approximately $13.9 billion, with his direct stake in Changxin valued at around 80 billion yuan. Additionally, over 6700 employees benefited from stock ownership plans, creating at least 237 new millionaires (in CNY). Zhu also pledged to donate 768 million shares, worth over 37.6 billion yuan, for future employee incentives over a ten-year period. Several prominent investors and corporate clients also reaped significant paper gains from the IPO. Notable figures include: * **Liang Wenfeng**, founder of DeepSeek, whose funds netted a paper profit of approximately 827 million yuan. * **Kong Jianping**, founder of Nano Labs, saw his indirect holdings valued at roughly 940 million yuan. * **Li Bin**, founder of Nio, whose company's strategic investment of 158 million yuan is now worth about 740 million yuan. * **Lei Jun**, founder of Xiaomi, whose subsidiary holds shares currently showing a paper gain of over 736 million yuan. Xiaomi clarified this is a corporate investment, not direct personal wealth. The article notes that while this IPO created immense wealth for insiders and large investors, retail investors who were lucky enough to win an allotment in the lottery typically profited by around 20,000 yuan. The listing solidifies Changxin's position as China's premier domestic memory chipmaker.

marsbitHace 54 min(s)

Huang Xiaoming, Li Bin, Lei Jun, Liang Wenfeng... Who Are the Biggest Winners in the CXMT IPO Feast?

marsbitHace 54 min(s)

Trading

Spot
活动图片