又是闪电贷,Web3世界空手套白狼?——Fswap被攻击事件分析

成都链安Опубліковано о 2022-06-14Востаннє оновлено о 2022-06-14

Анотація

BSC的Fswap合约遭受黑客闪电贷攻击,黑客获利约1751.6293WBNB,价值约40万美元。

2022年6月13日,成都链安链必应-区块链安全态势感知平台舆情监测显示,BSC的Fswap合约遭受黑客闪电贷攻击,黑客获利约1751.6293WBNB,价值约40万美元。成都链安安全团队第一时间对事件进行了分析。

#1什么是闪电贷

闪电贷概念最早由Marble协议于2018年提出。Marble自诩「智能合约银行」,其产品是很简单、但很具智慧的DeFi创新:通过智能化合约完成的零风险贷款。

闪电贷的基本工作原理是:在单笔交易中贷出借款人需要的金额。然而在交易结束时,借款人必须偿还不少于贷款金额的数目。如果借款人做不到,贷款机构会自动回滚交易。

简单讲,闪电贷是自动的:如果借款人不能偿还贷款,整个交易就会回滚,就像贷款根本没发生一样。

好,接下来我们来看本次事件是如何发生的。

#2事件相关信息

回到本次Fswap合约被攻击事件:

攻击交易

0xe75e30dafd865331e6a002d50effe084c21e413c96d4550d5e09cf647686fcbe

攻击者地址

0x0007D40F29c7A1713b251c69f5d999f16eC09Dfc

攻击合约

0x7437e7a923a5b467a197c6fae991f0f0ced9af57

被攻击合约

0x0d5F1226bd91b5582F6ED54DeeE739CAC49C37Db

#3攻击流程

第一步,攻击者先通过另外一个项目闪电贷一笔BSC-USD,将其中的大部分购买MC代币。

第二步,攻击者反复在pair中进行BSC-USD新的闪电贷,再将剩余的初始资金作为手续费支付。

第三步,每当用户在进行交换时,pair合约会向地址

0xe8a374c386d94b9b9d8feb801aec1ee44aad06ec发送交易对中的MC代币作为手续费。在这里会大量消耗合约里的MC,从而使MC的价格迅速上升。

第四步,攻击者再以初始购买的MC,交换大量的BSC-USD。偿还初始闪电贷后,将获利其兑换为WBNB。

最终,黑客就这样空手套白狼,获利约1751.6293WBNB。

#4漏洞分析

本次攻击主要利用了Fswap中pair合约在交易时会将合约中的reserve作为手续费发送给指定地址,从而导致价格的变化。

#5资金追踪

截止发文时,被盗资金1751.6293WBNB(约39.34万美元)已全部转移到Tornado.cash。

#6总结

闪电贷本身的存在是没有问题的,但有心之人将其利用,以极低的成本撬动巨量资金,在多个协议间进行价格操纵或套利,就存在风险。

针对本次事件,成都链安安全团队建议:Swap时的产生的手续费应该由用户支付,而不是用pair合约自身reserve支付。此外建议项目上线前选择专业的安全审计公司进行全面的安全审计,规避安全风险。

Пов'язані матеріали

Podcast Notes: Hyperliquid Has Become the Top Interest Point for Traditional Hedge Funds

Empire Podcast hosts Jason Yanowitz and Santiago Santos discuss the surging institutional interest in Hyperliquid, a decentralized perpetual exchange, marking the highest level of engagement from traditional hedge fund managers since Paul Tudor Jones endorsed Bitcoin in 2020. The primary driver is the demand for weekend trading of commodities like oil, especially during geopolitical tensions such as the Iran conflict, as Hyperliquid provides the only active price discovery venue when traditional markets are closed. Trade XYZ, a front-end on Hyperliquid, has seen significant growth, with weekend oil price predictions having a median error of only 50 basis points. Santos predicts commodity trading volume on Hyperliquid will surpass Bitcoin within the year and that its market cap could rise from $25 billion to $100 billion. Other key points include Kraken raising $200 million at a reduced valuation of $13.3 billion, and the SEC clarifying that self-custodied DeFi frontends like MetaMask are not subject to broker-dealer rules, resolving a major regulatory uncertainty. The hosts also note the strong correlation between crypto and macro markets, with the S&P 500 posting one of its best 10-day rallies since 1950. They highlight MicroStrategy's continued Bitcoin acquisitions and the potential of real-world asset (RWA) tokenization as a key trend. The discussion concludes with skepticism towards many L2 projects, predicting a wave of protocols truly going to zero as capital concentrates in proven assets like Bitcoin and Hyperliquid.

marsbit5 год тому

Podcast Notes: Hyperliquid Has Become the Top Interest Point for Traditional Hedge Funds

marsbit5 год тому

a16z: The Next Frontier of AI, The Triple Flywheel of Robotics, Autonomous Science, and Brain-Computer Interfaces

a16z presents a comprehensive investment thesis for the next frontier of AI: Physical AI, centered on a synergistic flywheel of robotics, autonomous science, and novel human-computer interfaces (HCIs) like brain-computers. While the current AI paradigm scales on language and code, the most disruptive future capabilities will emerge from three adjacent fields leveraging five core technical primitives: 1) learned representations of physical dynamics (via models like VLA, WAM, and native embodied models), 2) embodied action architectures (e.g., dual-system designs, diffusion-based motion generation, and RL fine-tuning like RECAP), 3) simulation and synthetic data as scaling infrastructure, 4) expanded sensory channels (touch, neural signals, silent speech, olfaction), and 5) closed-loop agent systems for long-horizon tasks. These primitives converge to power three key domains: * **Robotics:** The literal embodiment of AI, requiring all primitives for real-world physical interaction and manipulation. * **Autonomous Science:** Self-driving labs that conduct hypothesis-experiment-analysis loops, generating structured, causally-grounded data to improve physical AI models. * **Novel HCIs:** Devices (AR glasses, EMG wearables, BCIs) that expand human-AI bandwidth and act as massive data-collection networks for real-world human experience. These domains form a mutually reinforcing flywheel: Robotics enable autonomous labs, which in turn generate valuable data for robotics and materials science. New interfaces provide rich human-physical interaction data to train better robots and scientists. Together, they represent a new scaling axis for AI, moving beyond the digital realm to interact with and learn from physical reality, promising significant emergent capabilities and value.

marsbit5 год тому

a16z: The Next Frontier of AI, The Triple Flywheel of Robotics, Autonomous Science, and Brain-Computer Interfaces

marsbit5 год тому

Торгівля

Спот
Ф'ючерси
活动图片