header-langage
简体中文
繁體中文
English
Tiếng Việt
Scan to Download the APP
Partnered With:

Review 8 common DeFi economic model attack cases

Read this article in 22 Minutes
Arbitrage through the DeFi's rules is a blatant attempt to make money, clever but unpersuasive.
Original title: Foresight Ventures: Attacks of "Justice", Revisiting common DeFi economic model Attacks
Original article by Jonas, Foresight Ventures


In the dark forest of the crypto industry, Defi has become an ATM for hackers, with total losses so far this year exceeding $3bn. One is that Defi platforms hold a lot of money and the rewards for successful attacks are high. Second, most Defi protocol codes are open source, which makes them more vulnerable to network security threats. Three is because Defi is usually ecological interconnection, amplifying the convenience of attack.


The Token Terminal report shows that about 50% of Defi's vulnerabilities occur on cross-chain Bridges, followed by lending, trading platforms and machine gun pools.



The attack on the economic model of Defi is more valuable to study, especially the trend of some mechanisms in extreme cases, which is conducive to our understanding of Token economics. In a sense, if hackers steal assets through social engineering methods such as phishing and raiding repositories, it is considered ill-gotten gains. Similarly, arbitrage through the Defi rules is a clever but unsubtle way to make money.


Currency manipulation, liquidated by contract


Price fixing is the earliest and most common flaw in Defi. With the rise of on-chain derivatives, the profit/loss ratio of attacks has become high.


Case 1: MANGO


In October, the Solana chain's decentralized contract platform Mango was attacked.


Success factor: There is no position limit for Altcoin contracts


Attack flow:


a) 建仓:攻击者首先向 Mango 交易平台 A、B 地址分别各转入 500 万美元。而后黑客通过 A 地址在 Mango 上利用合约做空 Token MANGO;同时在 B 地址上做多 MANGO。多空双开的原因在于,虽然 Mango 平台对山寨币合约仓位没有限制,但是深度较差,如果不和自己作对手盘,仓位就很难开到这么高。


b) 操纵价格:攻击者使用更多资金购买 MANGO Token ,在 10 分钟内将其价格从 2 美分升至 91 美分。因为 MANGO 是一种流动性低的 Token ,这使得攻击者能够快速操纵价格。


c) Liquidation: At this time, the attacker earned $420 million from the long position and borrowed from the Mango platform by using the net assets of the account, but only lent $110 million due to the lack of liquidity.



Case 2: GMX


In September 22, GMX, the decentralized contract platform for Arbitum chain, was attacked.


Success factor: 0 slip point mechanism, low attack cost


Attack flow:


a) 建仓:攻击者在 GMX 上反复开大量 Token AVAX 多头和空头的头寸。


b) Price manipulation: Since GMX has a zero slip point, the feeder price is approximately equal to the strike price, but a large position on GMX will affect AVAX/USD prices on other trading platforms, and then the feeder will react and feed the price to GMX. A zero slip point means an attacker has unlimited liquidity at any given moment. To take an extreme example, if you were to go $1 billion long on AVAX on GMX, it would logically push up the price of the actual trade, but GMX's mechanism is zero slip point, so you would still open the position at the feeder price. However, this volume of trading will push up the price of other trading platforms AVAX. Assuming that the price increases by 20%, the prediction machine will send the latest price back to GMX. At this time, it can close the position based on the 20% price increase of AVAX, and withdraw the earned AVAX to sell on other trading platforms.


c) Liquidation: At this time, the attacker liquidated the position for profit. The AVAX gained by the attacker is the AVAX lost by the GLP holder.



Using the prophecy machine error, through the mortgage loan to liquidate


Such attacks are complex to execute, but follow a similar pattern, in which a system that relies on price feeding temporarily manipulates the price to distort the internal accounting of the agreement. The funds are then deposited at preferential rates and withdrawn in another currency or the same currency immediately after the machine is reset to normal.


Case 3: ANKR


In December 22, the Bsc chain lending protocol Helio was attacked.


Success factor: prophesy machine feed price is not timely


Attack flow:


a) Prediction machine error: Bsc chain pledge project Ankr was directly exploited by hackers to create 10 trillion aBNBc out of thin air, resulting in the price of aBNBc nearly zero. While the loan protocol Helio predictor machine feed price is set using a 6 hour average overtime weight.


b) Position building: The attacker used 10 BNBS to buy 180,000 aBNBc overissued by Ankr, and then exchanged the aBNBc for Hello's hBNB.


c) Mortgage lending: The attacker used hBNB as collateral to make loans in Helio and lent 16.44 million stable currency HAY.


d) Cash out: The attacker exchanged the stablecoin HAY into assets equivalent to $15 million such as BNB and USDC for cash withdrawal.



Case 4: XVS


May 22 Bsc chain lending agreement Venus under attack.


Success factor: prophesy machine feed price is not timely


Attack flow:


a) Prediction machine error: When LUNA add-issue crashed, Chainlink's price feedback to LUNA reached the lower limit and was suspended at $0.107. But the LUNA market on the Venus of the Bsc chain continues to operate, and the feed price comes from Chainlink. The team suspended the agreement only when the LUNA price was around $0.01.


b) Opening position: LUNA after the arbitrageurs issued a large number of additional shares from the secondary market, and mentioned the Bsc chain.


c) Realization of mortgage loan: The arbitrageurs borrow and borrow about 14 million dollars equivalent assets on Venus with LUNA as the collateral, and then withdraw.


Case 5: BZRX


In May 2001, bZx, the Bsc chain lending protocol, was attacked.


Success factor: Prediction machine price source single


Attack flow:


a) Position building: First, the attacker borrows 10,000 ETH from DYDX, a decentralized contract platform, through lightning loan, and uses 5,500 ETH to borrow 112 WBTCS from Compound, a lending platform.


b) Prediction machine error: bZx is a margin trading protocol. Users can pledge one currency as margin and lend another currency on leverage. The floating exchange rate of the two coins, bZx needs the prediction machine to feed the price and relies solely on the Uniswap price. The attacker used 1300 ETH to open a 5x empty ETH order on bZx (that is, 5637 ETH for WBTC). Due to the limited convertibility of WBTC in Uniswap pool, the WBTC price was driven up to 3 times the normal value.


c) Cash in: The attackers then sold 112 WBTCS borrowed from the Compound for a total profit of $360,000.



Oracle manipulation has always been a major target of Defi attacks, with Vee Finance, Harvest Finance, Value Defi, Warp Finance, and so on.


Short the Defi leverage, leading to a death spiral


In the bear market, liquidity is gradually lacking, and the price of non-mainstream assets is not deep enough and the volatility becomes large. The massive short selling is likely driven by a combination of Defi leverage liquidation and capital shorting.


Case 6: LUNA


In May 22, Terra Chain's Stable Coin UST was attacked.


Success factor: funds in a bear market liquidity run


Attack flow:


a) Position building: Attackers believe that LUNA-UST mechanism cannot be maintained for a long time. The high yield offered by Terra through Anchor is a drainage strategy to attract more users to use UST. But 20% is unsustainable. When the interest rate drops from 20% to 7-12%, about $9 billion worth of LUNA will leave. However, due to the insufficient liquidity of LUNA/UST, it is estimated that about $5 billion of UST will encounter the exit predicament. To exchange the $5 billion in UST for LUNA and safely leave the market, it would have required a LUNA market capitalization of $40 billion, at a time when LUNA's maximum market capitalization was only $40 billion. It seems that Terra has exhausted its reserves and has no money to maintain the stability of UST, or has given up on maintaining the stability of UST. Therefore, the window to observe whether it is still sustainable is whether the UST Pool on Curve is unbalanced. So when Terra removed $150m of liquidity from Curve in preparation for 4pools, the smaller liquidity pool size meant that UST sales had a bigger impact on prices than usual. Attackers began dumping $285 million worth of UST, causing Stablecoin to start dropping its anchor.


Word on the street is that the attacker, Alameda, borrowed a nine-figure BTC from Voyager to short BTC to intercept Terra's reserves before the UST collapse. Genesis Trading also provided $1 billion UST to Alameda, providing ammunition for an attack on UST anchors.


b) Leverage circular liquidation:


UST is an algorithmic stablecoin that uses a simple casting and destruction mechanism to maintain stability. To cast UST, LUNA of equal value must be destroyed; Users can also exchange the equivalent amount of LUNA by destroying UST. As USts fall, a hypothetical death spiral becomes a reality, with investors destroying USts in exchange for LUNA at lower and lower prices, thus overinflating the outstanding supply of LUNA. In fact, LUNA's supply has increased from less than 350 million to more than 6.5 trillion in just a few days.


UST was also liquidated in Abracadabra. In November last year, Abracadabra launched the Degenbox strategy for UST, where users pledge UST loan MIMs, which can greatly increase yields through revolving mortgage. As long as UST is maintained at $1, this strategy is basically risk-free. However, once UST is decoupled, the value of the user's collateral decreases and the risk of liquidation is raised. UST price to 0.97 will explode a batch, lower than 0.9 can explode more than 50% of people using this strategy. As the cycle continues, the lower the UST price, the more people will sell out.


Case 7: CRV


In November, 22, Curve, the decentralized stablecoin trading platform of ethereum chain, was attacked.


Success factor: A loan agreement can be secured against long-tail assets


Attack flow:


a) 建仓:Curve 的 Token 锁仓机制加上贿选机制,造成流动性严重不足。攻击者先在交易平台开 CRV 高倍率空单。


b) Borrowing and shorting: The attacker pledged 63.6 million USDC in AAVE before and after, and lent 92 million CRV to sell against the wall. As the price of CRVS plummeted, USDC collateral on the AAVE loan agreement could continue to lend more CRVS short.


c) Leveraged circular liquidation: Since CRVS are themselves collateral for loan agreements, the rapid decline in prices has also triggered a large number of CRVS to be liquidated, which could set off a chain reaction of death spirals. The attacker intended to penetrate the CRV founder's mortgage position clearing line and blow it up. Although the founder and the community joint shorting failed to explode, but the operation idea is still worth learning from.


Lightning loan governance attack


Defi attacks are no longer limited to price manipulation. If the agreement defense is insufficient, the vulnerability of governance mechanism may also be exploited by attackers.


Case 8: Beans


In April, 22, Ethereum chain decentralized stablecoin Beanstalk was attacked.


Success factor: No time lock on votable funds


Attack flow:


a) Proposal: The attacker issues a malicious proposal the day before the attack, and after the proposal is passed, funds will be withdrawn from the Beanstalk contract.


b) 建仓:攻击者通过闪电贷获得了 3.5 亿个 DAI、5 亿个 USDC、1.5 亿个 USDT、3200 万个 BEAN 和 1100 万个 LUSD 作为资金储备,从而积累了大量该协议的治理 Token 。


c) Vote: The attacker uses BEAN3CRV-f and BEANLUSD-f to vote on the proposal, thus causing the proposal to pass. The attacker gained 24830 ETH and 36 million BEAN stablecoins, earning about $80 million.



Despite the bear market, the Defi market still maintains some vitality. In terms of lock-in volume, if the crypto market is denominated in ETH, the native asset, rather than USD, then the TVL of the 22-year-old Maker DAO, Lido and other header projects will still achieve positive growth. Even in dollar terms, the Defi market still maintains a TVL of over $40 billion, which is much better than it was 21 years ago, meaning that the Defi market has become an integral part of the crypto market.


That bull run was the starting point for Defi's boom, and as the sector's rise has come into focus, attackers have turned their attention to it accordingly. It is clear from the above attack that there is no single way to attack the Defi protocol, but rather some common attack vectors that have caused some young Defi projects to fall prey. So far, the damage from these growing attacks has not been catastrophic. However, as the ecosystem continues to develop and the total lock-up volume grows, the money involved will become more significant and the attacks will become more profitable, and the future will see more sophisticated Defi attacks. Real knowledge comes from practice.


Original link


Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

举报 Correction/Report
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit