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

DForce event apocalypse: DeFi security and decentralization

Read this article in 25 Minutes
It is reported that the hacker returned 25 million us dollars because the IP address was leaked on the DEX 1inch. 1inch cooperated with the Singapore police and dForce team to pressure the hacker to return the stolen money.

To dForce: What doesn't kill you makes you STRONGER
Source: Odaily planet (ID: o-daily)

By wang ye & NBSP; Editor: wang mengdie

DeFi is already in the semi-decentralized governance stage, so there is no need to raise the level of conflict.




In just 48 hours, the hackers let the dForce team truly appreciate the beauty of "lost and found".

On the morning of April 19, lendf.me, a decentralized lending agreement developed by the dForce team, was hacked and its $25 million-worth of lock-up assets were looted, shaking the community and industry.

On the night of April 19, the hackers returned 12,614 PAX to the lendf.me account, along with a note from Better Future. On April 20, the hackers returned tokens one after another, and so far they have returned all the stolen assets.

The hackers allegedly leaked their IP addresses on the decentralized exchange 1inch. 1inch cooperated with the Singapore police and the dForce team to pressure the hackers to return the stolen money, and 1inch officials confirmed the process.

The dForce team sent out a post in the early hours of April 22 informing users of the next course of action: existing contracts will be permanently closed, new contracts will be activated for new products, and a proposed asset return will be announced within a week.

Fortunately, the theft of lendf.me did not result in the loss of users and the platform, but it has brought much more thinking and discussion than the incident itself.

After the incident, many viewers have published professional multi-disk content from multiple perspectives, but the daily planet Odaily still saw many wrong statements and biased arguments. Therefore, we also want to make clear with this article: What does not kill you makes you stronger, and we believe that the dForce team and DeFi industry will grow more healthily after the disaster.

Whose fault is DeFi's lego domino?


On April 19, the hackers took advantage of compatibility issues with the ERC777 contract and DeFi platform, called multiple re-entry attacks on lendf.me, and used imBTC as collateral to raid $25 million worth of assets on lendf.me.

After the theft of currency, the media and the focus of public attention is "accountability", a large amount of stolen funds, who is the pot? Although the incident has come to an end, there are still many misrepresentations in the community.

There has been a lot of talk, with some blaming the ERC777 for a breach in the contract. Questions were asked as to why Peckshied, dForce's security partner, failed to spot the breach in time; Others pointed the finger at imToken, claiming that there was a problem with imBTC, and the hackers mortgaged the fake imBTC and lent it to ETH.

The truth is, that's all wrong.

There is nothing wrong with the ERC777 contract itself. It is a modification and upgrade of the ERC20 contract, which not only realizes the function expansion, but also has good compatibility with the ERC20 standard.

Peckshied is not responsible for this either. Although PeckShield is a security partner of dForce, they have not audited the lendf.me code, which is based on the Compound V1 code.

Fake imBTC is also a rumor, there is no such process, there is no flaw in imBTC itself.

The fact that lendf.me added an erc777-based imBTC to the Compound V1 code gave hackers an advantage over compatibility issues with the DeFi protocol.

Specifically, ERC777 originally strengthened the risk control interface of Token on the basis of ERC20, which is a beneficial improvement. However, due to the composable nature of DeFi projects, the complexity of business logic for a contract to be invoked between different products also increases significantly, which opens up the possibility of injected code attacks.

According to the PeckShield team, one of the features of the ERC777 standard extension is a "hook" mechanism that allows a normal address or contract to control or reject a Token by registering a tokensToSend () hook function. To put it simply, the "hook" function sends notifications to both sides of a trade around the time it completes and allows them to cancel, ensuring that the trade is relatively objective.

Because the "hook" function notification takes time to operate, the hacker takes advantage of this to launch a reentrant attack, launching a new transaction before the user completes one, disrupting the original trading rhythm.



Photo courtesy of PeckShield

This may be a bit of a hurdle to understand, as the daily planet Odaily explains:

Alice has 100ETH, which she is ready to mortgage to Bob to lend 0.01 imBTC, but before the transaction is confirmed, Alice will mortgage the 100ETH to another counterparty, so Alice lends twice as much imBTC with the 100ETH. The hacker attack on lendf.me is a repeated cycle of the above process. The re-entry attack can be understood as the hacker generates a lot of "money" out of thin air, making the contract think it is legal "money", and then can use the mortgage loan method to withdraw all the real money.

From the above process, we can clearly understand that the ERC777 contract itself can actually greatly improve the user experience of DeFi application. Through the Hook callback mechanism, two or more completed confirmation transactions are required in ERC20, while a single transaction can be completed with ERC777.

The real source of the vulnerability is the compatibility problem between the ERC777 contract and the DeFi protocol.

The security team has made a number of security recommendations regarding the compatibility of the ERC777 contract with the DeFi protocol, and the attack has caused DeFi developers to seriously address the potential systemic risks to the DeFi portfolio.

Because of the composability and interoperability between DeFi protocols, the interaction between DeFi protocols has become deeper and more complex: even if a single protocol is safe to operate, it does not mean that the secure protocols are safe to use together.

Therefore, developers should not only pursue the "big" DeFi lego, but also do more in the system compatibility and security, after all, for financial products, "security" is the most important.

Accountability is not the goal, but rather the hope that once the problem is identified, it will not be defeated by similar problems.

The world is not black and white, and DeFi is already in a semi-central governance phase


On April 21, the story of the theft of lendf.me began a "god turn" that many onlookers lamented as cinematic.


According to the data, etherscan chain starting from 6 April 21 UTC, hackers from marked "Lendf. Me Hack" address to Lendf. Me project management address launched multiple transactions, including 57992 ETH (worth about 10 million dollars), as well as USDT, BUSD, TUSD stable currency (about $10 million), in addition, also returned 581 WBTC, HBTC and imBTC, total $24 million.



Image courtesy of etherscan

According to 1inch CEO Sergej Kunz, the hackers leaked important metadata headers about himself because they were using a web-based content distribution network, and all three requests came from a Chinese IP address, suggesting they were not using decentralised networks such as Tor. The information also includes the type of computer, screen resolution and system language used by the hackers.



Sergej Kunz says of the hacker, "he's supposed to be a good programmer, but he's an inexperienced hacker."


So while no official details have been released, it is possible to infer from what is known that the police and the dForce team had the hacking information, forcing the hackers to return the assets.

Whatever the process, the successful recovery of stolen assets is a rare happy ending for dForce and its users. However, 1inch's cooperation with the Singapore police to assist the dForce team in recovering the stolen assets and the disclosure of the hackers' IP addresses has triggered discussions in the community about DeFi's "protection of user privacy" and "pure decentralization".

DeFi, a decentralized lending platform that relies on centralized law enforcement to recover stolen assets, is justified by its supporters in disclosing the hackers' IP addresses. Despite its censoring nature, DeFi is not outside the law.

Opponents argue that 1inch's role as a decentralized trading platform runs counter to DeFi's intent to "protect user privacy."



The decentralized exchange ParaSwap made clear to users in Telegram's DeFi group that it would not disclose any information about its users, even if they were hackers.

1inch was quick to explain that "decentralization has nothing to do with privacy," that 1inch works within the scope of regulatory compliance, and that 1inch disclosed its privacy policy:




Although it refused To disclose The IP addresses of The hackers To dForce, according To The Block, ParaSwap's own products collect users' email and IP addresses, and there is no privacy policy on The ParaSwap website.

Some opponents argue that the move goes against DeFi's "decentralized" fundamentalism. They argue that the real DeFi is the DeFi users, not the developers, who are going after hackers or taking legal action against them. The lendf.me developer team is taking legal action to recover assets in the name of the company's principal, suggesting that the company is taking agency risk.

They subconsciously assume that DeFi exists to eliminate agency risk, and that if a company is taking on agency risk for a DeFi protocol, the DeFi is no different from CeFi.




In fact, according to the Odaily planet, these discussions are mostly biased and "stand and talk without pain". Recovering stolen assets with the power of centralized law enforcement agencies is the path young DeFi must take, and there is no need to rise to the level of "decentralized and centralized" conflict.

Moreover, "the world is complex", not only white or black, not only light or dark, it is multi-dimensional, multi-layered, multi-dimensional, the real world is not so binary.

Today, all of our lives and assets are not in the chain, and accountability takes place offline. The world of smart contracts is an incomplete world, and it is definitely not a place outside the law.

At the same time, blockchain is designed to protect personal privacy, rather than achieve absolute anonymity.

DeFi world is not only the code, in fact, from the past near the slump in "3.12" incident, we can also feel the decentralized DeFi join centralized after artificial regulation, to a greater degree of reducing the loss of assets resulting from the extreme market to the user, a decentralized trading contract agreement dYdX twice raised the minimum volume, synthetic asset trading platform Synthetix temporarily extend cost recovery in one hour, which effectively alleviate the transaction delays and congestion, avoids bring losses on assets to users.

One inch of police assistance can also be interpreted as a macro manipulation. For both developers and users of the platform, the loss caused by the theft of hacker currency is a "disaster". If the developer team fails to communicate and cooperate with inch and the police, the user's assets cannot be recovered, and the assets are gone, so how to talk about finance?

Code is dead, people are alive. There is nothing wrong with the young DeFi joining the manual controls to deal with extreme situations.

And strictly speaking, today's DeFi products are actually in a hybrid mode, with the asset being centralized at the chain level, decentralized at the programmability level, and semi-centralized at the governance level.

Therefore, the daily planet Odaily would like to say that today's DeFi is already in the stage of semi-centralized governance + decentralized agreement, and many DeFi fundamentalists generalize the concept of decentralized ideology, but actually lack the thinking of DeFi on the application level.

The practice of entrepreneurs is always step by step, making sarcastic remarks will not promote the development of the industry.

A wake-up call for the DeFi industry: comprehensive assessment and protection against systemic risk


Although the lendf.me theft ended with the recovery of all the assets, to be fair, there was a certain "fluke" factor in finding clues along the way from the hackers' "tail".


So the more important thing, of course, is how to prevent the "next time" when the "this time" has passed.

DeFi developers and practitioners must seriously consider the potential systemic risks to the DeFi business portfolio.

DeFi is a "building block combination" of related protocols and application modules, whose overall security depends on the least secure of all the building blocks.

According to the security of application/protocol/asset level, the risk of DeFi product is divided into the following aspects:

Risks introduced by the security of smart contract code:

Gollum believes that this is by far the most important risk for DeFi applications, accounting for the majority of the total risk.

Operational risks introduced by Admin Key for smart contracts (if any) :

What is the Admin Key for the smart contract? As a "robot" providing services, the intelligent contract often requires the operator to leave human rights to control the "robot", such as shutting down the "robot", and freezing the assets of an account in the intelligent contract. If such Admin Key human rights exist, an additional risk is introduced.

The risk of holding a particular asset itself:

The held asset itself has the market risk of price fluctuation, the risk of asset being frozen/confiscated by Admin Key of Token contract itself (if any), etc.

The market risk of DeFi itself.

The risks of a smart contract platform.

The risk of managing the user's own private key.

For these risks, the DeFi platform should not only ensure that there is a good code audit and vulnerability investigation before the product is launched, but also consider the potential systemic risk control problems due to the different business logic of different products when doing business combinations.

When dealing with the risk, other DeFi platform with security company cooperation in time, to do a good job of security audit code and the system risk, because Lendf. Me is the code of the fork Compound V1, and Compound V1 is the trail of bits of the company's audit, so he was not looking for a security company to do the audit, it's for a hacker attacks buried behind the unabomber.

Recognizing the seriousness of the problem, the dForce team announced in its latest announcement that it would permanently close existing contracts and that new contracts would be introduced for new products.




In fact, after the occurrence and resolution of the incident, both the users and the dForce community gave great moral support to the team. Many users who lost a lot of money still showed the position of "stolen incident will not defeat DeFi, believe the dForce team", which can fully show the industry's tolerance and friendliness to high-quality entrepreneurial teams.

But more importantly, the incident caused enough attention of the DeFi developers, and more investment in security, the security team should also enhance the diversity and comprehensiveness of DeFi product audit, also can develop more for the use of C end users can evaluate DeFi security tools and products, make DeFi everyone can rest assured the use of financial tools.

Safety is always the industry's bottom line, is the supreme rule.

Source link:https://www.odaily.com/post/5149277


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