当前位置:网站首页>零时科技 | 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 总结
此次攻击事件主要通过闪电贷资金控制价格,导致兑换数量波动,对于此类安全事件,建议不要使用外部可控的资金数量来获取价格,避免闪电贷攻击影响官方及用户资产,此外合约上线前应进行全面安全审计,将可能发生的安全风险规避掉。
边栏推荐
- Record the problem of Galaxy Kirin V10 server version once: an error is reported when installing KVM
- MAUI 迁移指南
- [cnn]|differences between CNN and transformer
- [pan micro E9 development] single sign on Kingdee eas
- Market prospect analysis and Research Report of beam combiner in 2022
- Lua removing elements from a loop in a list
- ETH 中继接口
- Summary of C language implementation of BP neural network
- 高考结束,可以干什么事情,专业应该如何选择?-- 来自一个在校大学生的肺腑之言
- Market prospect analysis and Research Report of marking laser in 2022
猜你喜欢

Student online education and teaching course management system based on SSM framework
![[network] socket programming](/img/df/2afc300bfc2dd319247a4b75ef7e2c.png)
[network] socket programming

2022 love analysis · privacy computing vendor panoramic report | love Analysis Report

Run Skynet for the first time

6. form label

Management system of College Students' associations based on SSM

Docker uses PXC to build a MySQL Cluster (mysql:5.7.24)

ESP series module burning firmware

Programming battle -- challenging college entrance examination questions

Detailed explanation of network time synchronization (NTP network timing) of video monitoring system
随机推荐
让人感到心灵平静,阳光温暖的图片
雷达辐射源调制信号仿真(代码)
Quartz:老而弥坚的开源任务调度框架,用起来够丝滑
Chinese classics for children
Embedded basic interface UART
Brew source change
三层带防护内网红队靶场
MAUI 遷移指南
A Security Analysis Of Browser Extensions
Manual testing cannot be changed to automated testing. What is missing?
How does the NTP clock server (satellite clock system) coordinate the integrated system?
Market prospect analysis and Research Report of electronic pelletizing counter in 2022
Source insight 4.0 setting shortcut keys for comments and uncomments
Market prospect analysis and Research Report of welding laser in 2022
Detailed explanation of scenario method for common test case design methods
Sentence s, paragraph P in VIM text object
Go failing - expected ‘package‘, found ‘EOF‘
Course classification tree structure display
6. 表格标签
Host computer development (how to develop host computer)