7

慢雾:DEUS Finance 二次被黑简析

 2 years ago
source link: https://www.ccvalue.cn/article/1396738.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

慢雾:DEUS Finance 二次被黑简析

 •  38 分钟前

碳链价值APP讯,据慢雾区情报,DEUS Finance DAO 在 4 月 28 日遭受闪电贷攻击,慢雾安全团队以简讯的形式将攻击原理分享如下:

1. 攻击者在攻击之前先往 DeiLenderSolidex 抵押了 Solidex sAMM-USDC/DEI 的 LP。

2. 在几个小时后攻击者先从多个池子闪电贷借出 143200000 USDC。

3. 随后攻击者使用借来的 USDC 在 BaseV1Pair 进行了 swap 操作,兑换出了 9547716.9 个的 DEI,由于 DeiLenderSolidex 中的 getOnChainPrice 函数是直接获取 DEI-USDC 交易对的代币余额进行 LP 价格计算。因此在此次 Swap 操作中将拉高 getOnChainPrice 函数获取的 LP 价格。

4. 在进行 Swap 操作后,攻击者在 DeiLenderSolidex 合约中通过 borrow 函数进行借贷, 由于 borrow 函数中用 isSolvent 进行借贷检查,而在 isSolvent 是使用了 getOnChainPrice 函数参与检查。但在步骤 3 中 getOnChainPrice 的结果已经被拉高了。导致攻击者超额借出更多的 DEI。

5. 最后着攻击者在把用借贷出来 DEI 兑换成 USDC 归还从几个池子借出来的USDC,获利离场。

针对该事件,我们给出以下防范建议:本次攻击的原因主要在于使用了不安全的预言机来计算 LP 价格,慢雾安全团队建议可以参考 Alpha Finance 关于获取公平 LP 价格的方法。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK