header-langage
简体中文
繁體中文
English
Tiếng Việt
한국어
日本語
ภาษาไทย
Türkçe
Scan to Download the APP

DeFi has had 82 security incidents so far in 2021, with initial stolen funds exceeding $1.8 billion

Read this article in 27 Minutes
As DeFi attracted millions of dollars in a short period of time, it became the target of numerous hacking attacks and on-chain security incidents.
DeFi has 82 security breaches and over $1.8 billion in initial stolen funds so far in 2021
Original article: Chenchenzhu, Oko Cloud Chain


As one of the greatest technological developments of the past decade, blockchain has brought innovative progress to traditional finance, cross-border payment and settlement, supply chain, credit investigation and anti-fraud, user privacy and other application fields. Decentralized finance (DeFi), nurtured by the original ideas and culture of blockchain, has emerged as a disruptor. It aims to build a financial system that is free of third parties, fair and autonomous, and open to all. DeFi is considered to have infinite vitality and possibility, and is expected to restructure financial transaction and service mode. After more than two years of hibernation, DeFi broke out at the end of June 2020 and developed rapidly. DeFi has become one of the most eye-catching applications in the current blockchain world, with the largest implementation in the financial field and the highest adoption rate. But as DeFi attracted millions of dollars in a short period of time, it also made them the target of numerous hacking attacks and on-chain security incidents.


According to publicly available data, there were 60 DeFi attacks in 2020, costing more than $250 million, at least 10 of which were flash loan attacks, Several DeFi projects including bZx, Balancer, Harvest, Akropolis, Cheese Bank, Value DeFi and Origin Protocol were attacked.


Although there are still nearly two months to go before 2021 ends, as of November 7, 2021 has already happened so far, according to OKLink's incomplete statistics82On-chain security issues, initial stolen funds about1.816 billion dollars, but about $700 million of that has been returned, bringing the total stolen money to $1.116 billion.


Compared with 2020, in addition to the significant increase in the number of attacks, the amount of money stolen from a single project has also significantly increased in magnitude. According to Rekt, only one of the top 10 D hacks occurred in 2020. The top three arePoly Network ($611 million), Compound ($147 million) and Cream Finance ($130 million).



Source: rekt.news


Poly Network alone had more stolen money than in all of 2020, though the hackers who attacked the project have since returned all the stolen money. The most recent large-scale attack, when Cream Finance suffered a flash loan attack on October 28, lost over $130 million in stolen funds mainly Cream LP tokens and other ERC-20 tokens. It is understood that this is not the first attack against Cream Finance. In 2021 alone, Cream Finance has suffered three attacks and lost a total of 57.4 million DOLLARS due to flash loans, contract loopholes or the joint impact of other DeFi projects.


From 82 security incidents since the beginning of 2021, we found thatFlash loans are the most common method used by hackers, accounting for 33 cases, followed by contract loopholes with 27 cases. In addition, changes in incentives and leaks of private keys or mnemonics can also lead to attacks. Next, we will show you specific cases.


1.Cream Finance suffered another lightning loan attack, losing $130 million


On October 27, DeFi lending protocol Cream Finance was hit by a flash loan attack in which attackers withdrew about $130 million in tokens from the C.R.E.A.M. Ethereum V1 market.


Flash loan refers to a loan method that borrows and repays in the same block without mortgaging assets. It should be noted that flash loan itself is only a tool, there is no good or bad, but because flash loan appears in DeFi thunder thunder related news from time to time, in the eyes of many people who do not know the reason, flash loan seems to become an accomplice of malicious attackers, which is actually a misunderstanding of flash loan.


In fact, flash loans are even a great innovation in smart contracts. Due to the structural defects of DeFi, most mortgage lending agreements require users to overpledge assets, which means that the utilization of funds will become very low. Lightning loans, greatly reduces the cost of capital, the user can in the case of without any mortgage, only need to pay a small fee (such as lightning on the AAVE loan fees just 0.09%), can get a huge sums of money, the user after its money, can borrow money for other use of the operation, at the end of the deal, Simply pay back the loan and fees promptly, otherwise the trade rolls back as if nothing had happened, so it can be used for arbitrage, collateral exchange and self-clearing.


For the Cream Finance attack, attackers borrowed 500 million DAI from MakerDAO flash loans and then pledged them for 451 million yDAI, Then add liquidity of yDAI to Curve ySwap to obtain 447 million yDAI+yUSDC+yUSDT+yTUSD.



Photo source:OKLink


Then the attacker pledged 447 million yDAI+yUSDC+yUSDT+yTUSD and obtained nearly 447 million yUSD. By calling the coinage function in crYUSD, nearly 22.338 billion crYUSD was cast.



Photo source:OKLink


Then the attack contract creates the attack contract 2, and calls the flashLoanAAVE() function of attack contract 2. Firstly, 524,100 WETH is borrowed from AAVE, of which 6,000 WETH is sent to the attack contract 0x961D. The remaining WETH is deposited into Cream to obtain crETH. Use attack contract 2 to lend nearly 447 million yUSD, repeat twice, and cast crYUSD. After the coin is minted, the crYUSD is transferred to attack contract 0x961D. Attack contract 2 0xf701 Another 447 million yUSD is lent for the third time, this time directly transferred to attack contract 0x961D.




Photo source:OKLink


The attacker uses 1,873 to get 7,453,000 USdcs in Uniswap V3, and uses Curve. Fi to change 3,783,300 USdcs into 3,726,500 DUSD. Then replace DUSD with 450 million yDAI+yUSDC+yUSDT+yTUSD.



Photo source:OKLink


Subsequently, 8,431,500 yDAI+yUSDC+yUSDT+yTUSD were directly sent back to the yUSD mortgage pool, resulting in a sharp increase in the calculation of the value of the mortgage asset yUSD under Cream agreement. Finally, a large number of 15 assets, including CRETH2, xSUSHI and PERP, were lent out. And return the WETH lightning loan out of Attack Contract 2.



  Photo source:OKLink


Finally redeem each asset into DAI, return attack contract 0x961D lightning loan.



    Photo source:OKLink


This attack is a typical price manipulation of flash loans. After obtaining a large amount of funds through flash loans, the contract design defects are utilized to change the price substantially and make profits. This is the fourth hacker attack that Cream Finance has suffered this year. The essence of flash loan attack is that the attackers who initiate flash loan just make use of the characteristics of flash loan to lend money, trade, and then deposit and lend a large amount of money in a short period of time, so that they can artificially manipulate the price of specific crypto assets in a DEX, and then profit from it. In other words, the attacker's operation in the flash loan process itself is compliant, but from the result, this behavior damages the fairness of the smart contract and the interests of other users.


2. Poly Network, the largest DeFi theft in history


On August 10, 2021, the Heterogeneous chain cross-chain interoperability protocol Poly Network was attacked. O3 Swap, which uses this protocol, suffered heavy losses. According to the browser on OKLink chain, hackers took away a total of 610 million US dollars of cryptographic assets in more than 30 minutes. Batch transfer to 3 addresses. More than $250 million went to the BSC address at 0x0D6e, more than $270 million went to the Ethereum address at 0xC8a6 and more than $85 million went to 0x5dc3.


The main reason for this attack is that hackers take advantage of the vulnerability in the EthCrossChainManager contract. The Keeper permission of the EthCrossChainData contract can be modified by the EthCrossChainManager contract. The EthCrossChainManager contract's verifyHeaderAndExecuteTx function can be called by any user for transaction execution, and when a call is made within it, A malicious user can pass in self-constructed data via the _executeCrossChainTx function, which allows a hacker to change EthCrossChainData's Keeper to his own address and retrieve tokens from the LockProxy contract.


The following is a map of the attack by the Oculus team on the Oko Cloud chain.








Because the $610 million involved was so high profile, platforms were responding to the incident in an effort to prevent hackers from using platform features to move the money around, and The TeamEyes team was able to synchronize attacker information with the security team in compliance, buying valuable time to track down the attackers.


According to Dune Analytics, the current TVL of cross-chain Bridges exceeds us $38.8 billion. Although the emergence of cross-chain Bridges, as an emerging field, breaks the phenomenon of islands between chains, due to its rapid development, huge amount of funding, and uneven level of projects on the chain, Naturally, it became a hot item in the eyes of hackers.




On July 11, ChainSwap, a cross-chain project, was hacked. Tokens from more than 20 projects deployed on the bridge were stolen, resulting in a loss of about $4.4 million. The main reason for this security incident is that each token has a proxy contract when it is transferred across the chain, and the hacker needs to pay 0.005 ETH in _chargeFee when calling the contract. However, there is no real authentication check in this process, only one signature is required, and the problem may be _decreaseAuthQuota function. This function resumes if the signer quota has been completed that day. But everyone seems to start with the default quota. So attackers simply sign with a different address each time to get around this. The "volume" parameter is then passed to the "to" attacker address in the _receive function.


Just a day later, AnySwap, another well-known cross-chain project, was attacked, losing 2.39 million USDC and 5.5 million MIM on its new V3 cross-chain liquidity pool, for a total loss of more than $7.9 million. According to the AnySwap bulletin, two V3 router transactions were detected under the V3 router MPC account on the BSC, both transactions had the same R-value signature, and the hackers pushed back to the private key of this MPC account. The team has fixed the code to avoid using the same R-signature.


Poly NetWork is not the first and will not be the last security incident of cross-chain bridge. Due to the rapid growth of TVL, cross-chain bridge will inevitably continue to become a frequent occurrence of security incidents. Although Poly NetWork ended with hackers returning all assets, this incident is also a warning. In other words, as a more complex business scenario, cross-chain bridge should have stricter requirements on contract writing and audit, and more attention should be paid to security issues such as administrator authority and private key authorization.


3. BXH is stolen due to private key leakage


BXH, a decentralized transaction protocol for multi-chain deployment, was stolen on October 30, looting $139 million in crypto assets. It is understood that the security incident occurred in the BXH protocol on the BSC chain. Out of caution, BXH officially suspended Heco, OEC related deposit and withdrawal services.


Immediately after the incident, the Visualize team monitored the hacker's addresses on the BSC, Ethereum and Bitcoin chains, and warned exchanges and wallets to strengthen address monitoring to prevent malicious funds from flowing into the platform. After a review, tianyan team analyzed that the hacker deployed the attack contract 0x8877 on October 27, and then on October 29, BXH administrator address 0x5614 granted the management rights to the attack contract 0x8877 through grantRole. On October 30, hackers moved assets out of BXH's vaults by attacking the contract's administrative rights.


Simple to understand is that somebody got BXH administrators to the private key, and then set another address as the administrator, and then through the another address all her money away, this survey results, caused uproar, after all the stolen money means very original, hackers do not need to conquer complex intelligent contracts, only $139 million of funds were extracted by the private key.


The theft of assets on the BXH chain also created a chain reaction in which the associated machine gun pool that depended on BXH liquidity was also affected, with CoinWind and Earn DeFi successively shutting down the recharge. On the evening of October 31, BXH publicized its remaining assets in the capital pool on the BSC chain, including USDT, USDC, BTC, ETH, BUSD and MDX, totaling about 184 million DOLLARS on the official media.




As of November 9, BXH's latest update is that the project owner states that the project's activity on OEC has returned to normal after continuous testing, elimination of potential risks, and completion of a multi-signature upgrade for private key verification.


Rug Pull attack


A commonly used term in DeFi circles, Rug Pull refers to the withdrawal of support from a project, the DEX liquidity pool, or the abrupt abandonment of a project, and the withdrawal of investors' money without warning. Rug Pull is a typical scam in the DeFi field, and is often found in DEX. Liars will invest a lot of money in the pool of liquidity, and attractive advertising on social media to attract investors into the bureau, once the investor deposited the tokens in the liquidity pool, liar will smoke "carpet" to go forward all of the tokens in the pond, is usually a malicious attack the last step of the team, also is a kind of common exit scam. Because Rug Pull is technically simple to implement, it is often the usual practice of local dog projects (low investment, no audit, Copy Cat) after they create the illusion of "quick money" to trick retail investors into getting on board.


On July 15, digital collectibles platform Bondly Finance was hacked and 373 million Bondly coins were minted on the Ethereum network, resulting ina $5.9 million loss in token prices and a suspicious Rug Pull. According to the project's own disclosure, the attacker, through an elaborate strategy, gained access to the password account of Bondly Finance CEO Brandon Smith, which contains the mnemonic recovery phrase for his hardware wallet, copied to allow the attacker access to the Bondly smart contract, And the company wallet, which was also leaked. Brandon maintains exclusive access to most of Bondly's corporate wallets. These wallets include all decentralized exchange liquidity pool tokens, investment account tokens, mortgage reserve tokens, eco-fund tokens, payslips, corporate reserves, all NFT wallets and Opensea reserves.


conclusion


With the rapid development of blockchain on a global scale, the corresponding on-chain security incidents are also constantly breeding. Compared with last year, in the field of DeFi security situation is still grim, chain problem to be reckoned with, compared with the new holes, we found that most hackers are already appeared the loophole, the rise of EVM entry compatible chain makes the hacker attack from the etheric fang transferred to the other chain, but the attack technique, on the one hand, the project needs to improve the requirements of oneself, On the other hand, it also shows the problems of DeFi's existing similar projects. Many projects fork directly or innovate on the basis of fork, and such a result is easy to bring hidden risks or hidden loopholes. For example, AutoShark Finance and Merlin on the BSC chain suffered a series of flash loan attacks, losing $750,000 and $6.8 million respectively, due to the Pancake Bunny on the fork, which resulted in arbitrage with the same risk.


We hope that every security incident can bring warnings to the industry. Although we can't avoid all problems, we should pay attention to frequent loopholes and strengthen the implementation of contract audit, risk control, emergency response and other aspects. Security issues on the chain should receive the highest attention, rather than blindly pursuing hot products and rushing to launch products without doing a good job in project security review, which is not only irresponsible to users' assets, but also the consumption of the ecology on the blockchain chain. Users also need to enhance their security awareness and do a good job in DYOR. Anonymous teams, unaudited, obvious copycat projects, for example, can incorporate their own pit stop and keep primary risks out of the way.


The 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