当前位置:网站首页>零时科技 | Discover 闪电贷攻击事件分析
零时科技 | Discover 闪电贷攻击事件分析
2022-06-11 03:52:00 【零时科技】

0x1 事件背景
零时科技区块链安全情报平台监控到消息,北京时间 2022年6月6日 Binance 链上 Discover 智能合约遭到闪电贷攻击。零时科技安全团队及时对此安全事件进行分析。
0x2 攻击者信息
- 攻击者钱包:
0x446247bb10B77D1BCa4D4A396E014526D1ABA277
- 攻击者合约:
0x06b912354b167848a4a608a56bc26c680dad3d79
0xfa9c2157cf3d8cbfd54f6bef7388fbcd7dc90bd6
- 攻击交易:
0x8a33a1f8c7af372a9c81ede9e442114f0aabb537e5c3a22c0fd7231c4820f1e9
0x1dd4989052f69cd388f4dfbeb1690a3f3a323ebb73df816e5ef2466dc98fa4a4
- ETHpledge合约:
0xe732a7bD6706CBD6834B300D7c56a8D2096723A7
0x3 攻击分析
攻击者主要的攻击交易流程:

- 通过PancakeSwap闪电贷分别借款 2100枚 USD 和 19810 枚 USD。
- 将 2000 枚 USD 转移至 ETHpledge 合约0xe732a。ETHpledge 合约返回 62,536 枚 Discover。
- 将 19,810 枚 USD 归还闪电贷至 BSC-USD-Discover。
- 将 62,536 枚 Discover 换取USD,获得 16,336 枚 USD。
- 归还 2,100 枚 闪电贷借款,将剩余的 USD 兑换为 BNB,获利离场。
0x4 漏洞细节
ETHpledge.team

ETHpledge.pledgein方法作用是,调用者转入USDT资金后收到一定比例的Discover代币,这里转入USDT资金在pledgein方法执行,接收Discover代币的逻辑在ETHpledge.team方法实现,获取价格逻辑在ETHpledge.getprice方法实现。
漏洞解析
攻击者调用ETHpledge.pledgein方法之前通过闪电贷借到大量USDT资金,使得 usdt.balanceOf 资金变少,之后调用ETHpledge.pledgein方法将少量USDT转入,随后调用ETHpledge.getprice方法获取价格,由于usdt.balanceOf 减少,所以_price变小,_swapprice变小,最终转账数量的curTamount变量增大。从而兑换的Discover代币数量增加。
在兑换了大量Discover代币后,攻击者随后迅速归还了数量较多的一笔USDT闪电贷借款。随后使用Discover代币正常兑换出较多的USDT。
0x5 资金流向
目前黑客已将获利的 49 枚 BNB 转移至 Tornado.Cash混币平台。

0x6 总结
此次攻击事件主要通过闪电贷资金控制价格,导致兑换数量波动,对于此类安全事件,建议不要使用外部可控的资金数量来获取价格,避免闪电贷攻击影响官方及用户资产,此外合约上线前应进行全面安全审计,将可能发生的安全风险规避掉。
边栏推荐
- ESP series module burning firmware
- 软件工程笔记之期末复习(简答)
- Red team shooting range with three-layer protection
- Comparison of four delivery modes of Message Oriented Middleware
- Market prospect analysis and Research Report of beam combiner in 2022
- A - Eddy's AC puzzle (C language)
- [interpretable] | axiomatic attribute for deep networks
- Several time synchronization methods of Beidou timing system (GPS timing equipment)
- Market prospect analysis and Research Report of electronic pelletizing counter in 2022
- Docker uses PXC to build a MySQL Cluster (mysql:5.7.24)
猜你喜欢

Record a VMware problem

Pci/pcie related knowledge

开源项目 英雄联盟 之WPF

7. 列表标签

Discussion on the development trend of remote power management unit (Intelligent PDU)

Docker swarm installs redis cluster (bitnami/redis cluster:latest)
![[signalr complete series] Net6 Zhongshi signalr communication](/img/af/4b8bfea6238c646c54352635d5da98.png)
[signalr complete series] Net6 Zhongshi signalr communication

Docker builds a redis Cluster - three machines, three masters and three slaves

SSLStrip 终极版 —— location 劫持

2022爱分析· 隐私计算厂商全景报告 | 爱分析报告
随机推荐
什么样的人才是幸福的?
After the installation of Damon database is completed, query whether it is case sensitive
Market prospect analysis and Research Report of nitrogen liquefier in 2022
人与人的一些不同
华生·K的秘密日记
[dataset] | UAV Perspective
Samsung Galaxy S21 ultra and Apple iPhone 13 Pro Max: which one should you choose
Rational use of thread pool and thread variables
Red team shooting range with three-layer protection
MAUI 迁移指南
Application of NTP network time server (PTP clock synchronization) in it network
代码复现CSRF攻击并解决它
密码找回功能可能存在的问题(补充)
Synchronized locked objects
Market prospect analysis and Research Report of surround packing machine in 2022
Eth Of Erc20 And Erc721
After the college entrance examination, what can I do and how should I choose my major-- From the heart of a college student
Protection and bypass of repeated contracting
Sentence s, paragraph P in VIM text object
关于重复发包的防护与绕过