Dot Finance闪电贷安全事件分析
前言
8 月 25 日, 知道创宇区块链安全实验室 监测到 BSC 链上的 DeFi 协议 Dot Finance 遭遇闪电贷袭击,价值跌落近 35%。实验室第一时间跟踪本次事件并分析。
涉及对象
黑客地址:
0xDFD78a977c08221822F6699AD933869Da6d9720C
攻击合约地址:
0x33f9bB37d60Fa6424230e6Cf11b2d47Db424C879
受害合约地址:
0x16fd050f05f8fc361cf9083aa3f624a2bf7e914d0xbfca3b1df0ae863e966b9e35b9a3a3fee2ad8b07
攻击涉及主要函数分析
分析交易哈希:
0x68170a309ab2e944e178ccf9bf6f19e25a3f356031ce53539bb9669fc77172f2
swap函数
1.整个交易都始于 PancakePair swap函数
2.为攻击提供资金支持
get reward 函数
1.使用 balanceOf(address(this)) 获取 CAKE 代币余额
2.通过 CAKE 代币余额来铸造奖励
简要过程及原理分析
1.黑客使用 PancakeSwap 闪电贷获得初始资金 100 Cake 代币;
2.通过将 Cake 代币 打入 VaultPinkBNB 合约,来影响 getReward 函数获取合约 Cake 代币真实值,同时 performanceFee 参数受 Cake 代币真实值影响数值巨大;
3.最后 mintFor 函数使用受影响的 performanceFee 参数向黑客铸造大量 pink 代币奖励;
总结
此次攻击属于 PancakeBunny 同类型的攻击事件,迄今为止此类攻击事件已发生多次,知道创宇区块链安全实验室再次提醒,近期 BSC 链上频频爆发攻击事件,合约安全愈发需要得到迫切重视,合约审计、风控措施、应急计划等都有必要切实落实。
Ripple President Sidesteps IPO Talk, Emphasizes "Healthy" Financial Position, Growth Focus
While the prospect of a Ripple IPO has been a recurring topic of speculation, Monica Long's recent s...
Top 10 Blockchains by DeFi TVL Growth: Ethereum, Solana, BSC, Bitcoin, & Tron Lead
These are the leading blockchains with top TVL growth over the past seven days. TVL is an essential ...
XRP Lawsuit in the Rearview, Ripple Goes Full Speed Ahead with $1.25B Deal
The post XRP Lawsuit in the Rearview, Ripple Goes Full Speed Ahead with $1.25B Deal appeared first o...