Cointime

Download App
iOS & Android

SharkTeam:Woo Finance被攻击事件分析

2024年3月5日,Woo Finance部署在Arbitrum上的合约遭受闪电贷攻击,损失约850万美元。此前,2月23日,Woo Finance部署在Ethereum上的合约就曾被攻击,损失约3,891美元,很显然黑客团队将Woo Finance作为攻击目标进行了系统化的漏洞挖掘,非常可惜Woo Finance没有能及时对多链合约的安全性进行全面检查,没能阻止这次攻击。

SharkTeam对此事件第一时间进行了技术分析,并总结了安全防范手段,希望后续项目可以引以为戒,共筑区块链行业的安全防线。

一、攻击交易分析

攻击者地址:

0x9961190b258897bca7a12b8f37f415e689d281c4

攻击合约:

0x1759f791214168e0292ab6b2180da1c4cf9b764e

0xc3910dca5d3931f4a10261b8f58e1a19a13e0203

0xd4c633c9a765bc690e1fba566981c1f4eab52df0

0x66634590d7d631e3bf85ef4cd6c89ca7479e22bc

0x27a116a48c6dd23fc005ea6ea02847723d5b3856

0x2458464afec10e973ac61860718328ce8358be3a

被攻击合约:

0xeff23b4be1091b53205e35f3afcd9c7182bf3062

攻击交易:

0x57e555328b7def90e1fc2a0f7aa6df8d601a8f15803800a5aaf0a20382f21fbd

0x40e1b8c78083fc666cb7598efcecd0ae0af313fc41441386e4db716c2808ce07

0xe80a16678b5008d5be1484ec6e9e77dc6307632030553405863ffb38c1f94266

攻击流程:

1. 以第一笔攻击交易为例,攻击合约(0x1759f791)通过闪电贷借取10580749枚USDC.e代币和2704558枚WOO代币。

2. 后通过在Silo合约中抵押7000000枚USDC.e代币,借出了5092663枚WOO代币,再将2000000枚USDC.e代币兑换成了WETH。

3. 攻击合约(0x1759f791)将100000枚USDC.e兑换为173684枚WOO,并略微抬高WOO的价格。

4. 攻击合约(0x1759f791)用7856868枚WOO代币在被攻击合约(0xeff23b4b)中兑换为2246892枚USDC.e,并将合约中WOO代币的价格从578535. 在价格被更改后,攻击合约(0x1759f791)仅用0.9枚USDC.e就换出了10232908枚WOO。

5. 在价格被更改后,攻击合约(0x1759f791)仅用0.9枚USDC.e就换出了10232908枚WOO。

6. 攻击合约(0x1759f791)归还silo中借出的WOO代币提出抵押的USDC.e代币并归还闪电贷函数,最后获利559枚ETH和2549710枚WOO。

攻击的本质是合约的价格计算式中参数可以被黑客操控,导致WOO代币的价格被操纵。被攻击合约(0xeff23b4b)中_calcQuoteAmountSellBase对价格进行计算时逻辑出现漏洞。

价格计算式中的baseAmount以及state.price都可以被操控,攻击者(0x9961190b)在第三步时抬高了一些stake.price,第四步使用大量WOO代币进行兑换,导致baseAmount参数很大,由于红框中计算的结果作为减数存在,所以当红框计算结果越大,newPrice参数越小,使得兑换结束后price值被设定为了9。价格比例严重失衡,使用极少USDC.e即可换出大量WOO代币。

针针对本次攻击事件,我们在开发过程中应注意以下事项:

1. 开发者在设计价格计算式时,应严格考虑参数是否会被操控的问题。

2. 项目上线前,需要通过专业的第三方审计团队进行智能合约审计。

About Us

SharkTeam的愿景是保护Web3世界的安全。团队由来自世界各地的经验丰富的安全专业人士和高级研究人员组成,精通区块链和智能合约底层理论。提供包括风险识别与阻断、智能合约审计、KYT/AML、链上分析等服务,并打造了链上智能风险识别与阻断平台ChainAegis,能有效对抗Web3世界的高级持续性威胁(Advanced Persistent Threat,APT)。已与Web3生态各领域的关键参与者,如Polkadot、Moonbeam、polygon、Sui、OKX、imToken、Collab.Land等建立长期合作关系。

官网:https://www.sharkteam.org

Twitter:https://twitter.com/sharkteamorg

Telegram:https://t.me/sharkteamorg

Discord:https://discord.gg/jGH9xXCjDZ

Comments

All Comments

Recommended for you

  • Cointime May 4th News Express

    1. Hong Kong Bitcoin Spot ETF has held 4,218 BTC since its listing three days ago

  • Blockchain Asset Management announces launch of a dedicated blockchain fund for accredited investors

    Blockchain Asset Management, a cryptocurrency fund with a scale of $100 million, announced the launch of an exclusive blockchain fund for qualified investors. The specific amount of funds raised by the fund has not been disclosed yet, but it is said to have reached "eight figures", which means it is in the tens of millions of dollars. In addition, the investment threshold for the new fund is $100,000, and all investors are required to meet the approved standards (annual income exceeding $200,000, net assets exceeding $1 million).

  • Renault's BWT Alpine F1 Team announces partnership with ApeCoinDAO

    The BWT Alpine F1 team under Renault announced a partnership with ApeCoinDAO on X platform, which will introduce APE into the Alpine F1 ecosystem and collaborate with global token holders to launch peripheral products and digital assets inspired by the first ApeCoin. It is reported that according to the cooperation between the two parties, in the future, BAYC NFTs may be able to wear equipment and clothing with the Alpine team logo.

  • BTC breaks through $63,000

    The market shows BTC has broken through $63,000 and is currently trading at $63,014.9, with a daily increase of 6.11%. The market is volatile, so please exercise caution in risk management.

  • The total gas consumption on the Base chain exceeds 10,000 ETH

    According to the blockchain analysis platform Dune Analytics, the total gas consumption on the Base chain has exceeded 10,000 ETH, reaching 10,839.5062 ETH at the time of writing (equivalent to over $33.6 million at current prices). The average gas usage amount is about $0.1754 per transaction (0.000059661 ETH), and the total number of blocks has reached 13.41 million, with an average transaction volume of about 14.63 transactions per block. In addition, the data shows that the total transaction volume on the Base chain has exceeded 196.2 million, with over 8.366 million users and over 184 million user transactions at the time of writing. Furthermore, the total number of contracts created on the Base chain has exceeded 64 million, reaching 64,056,573 in the current period.

  • A wallet received 2,000 ETH from Alemeda/FTX

    As monitored by The Data Nerd, 6 hours ago, wallet 0xaEa received 2,000 ETH (approximately $6.23 million) from Alemeda/FTX. Within a week, it received a total of 8,000 ETH (approximately $24.71 million) from Alameda and deposited 6,000 ETH into Binance.

  • A single transaction with a transaction fee of up to 1.5 BTC appeared on the Bitcoin chain

    According to on-chain data tracking service monitoring , there has been a single transaction on the Bitcoin network with a transaction fee as high as 1.5 BTC, worth about $100,254. It is reported that the sender of the transaction is an address starting with "bc1p4n" and the recipient is an address starting with "bc1pqv".

  • 2 wallets deposited 211 billion SHIB into Coinbase within 10 hours

    According to The Data Nerd's monitoring, within 10 hours, 2 wallets (with the same amount of SHIB) deposited a total of 211 billion SHIB (about 5.16 million US dollars) into Coinbase. These wallets accumulated these SHIBs last week, and if sold at the current price, it would cause a small loss (about 120,000 US dollars).

  • Sharding Capital: 为什么投资全链流动性基础设施 Entangle

    Entangle 项目的名称取自于量子纠缠(Quantum entanglement),体现了项目对于构建连接、关联和互通的愿景。就像量子纠缠将不同的粒子联系在一起,Entangle 旨在通过其跨链流动性和合成衍生品的解决方案将不同的区块链网络连接在一起,创造一个统一、互通的 Web3 生态系统。

  • Is AO's Financial Ecosystem Ready to Take Off? A Quick Look at Newly Launched DeFi, Cross-Chain Bridges, and Wallet Projects

    Shortly after the launch of the super parallel computing network AO, both the cross-chain payment protocol everPay and the decentralized exchange Permaswap, under the umbrella of everVision, announced the adaptation of all functionalities to AO.