Cointime

Download App
iOS & Android

Logic flaw: Analysis of the DEUS attack incident

On May 6, 2023, Beijing time, a burn logic flaw was discovered in DEUS’s stablecoin DEI contract, resulting in an attacker gaining approximately $6.3 million in profits.

SharkTeam conducted a technical analysis of the incident and has summarized security measures as a precautionary lesson for future projects, aiming to strengthen the security defenses of the blockchain industry.

Analysis of the Incident

Attacker address:

0x08e80ecb146dc0b835cf3d6c48da97556998f599

Attack contract: 0x2b1a7a457a2c55ba1e03c087cc3e4e5b05b6360f

Vulnerable contract:

0xDE1E704dae0B4051e80DAbB26ab6ad6c12262DA0

Attack transactions:

0xde2c8718a9efd8db0eaf9d8141089a22a89bca7d1415d04c05ba107dc1a190c3

The execution flow of the attack transaction:

1. First, the attacker (0x08e80ecb) calls the attack function of the attack contract (0x2b1a7a45).

2. In the attack function, call the approve->burnFrom->transferFrom function of the vulnerable contract (0xDE1E704d)

3. In the transferFrom function, transfer 1.1 million DEI to your own account, and finally call the swap of the trading pair to exchange DEI for USD and transfer it to the attacker (0x08e80ecb).

Vulnerability analysis:

In the burnFrom function, the allowance of the sender to the account and the allowance of the account to the sender are copied directly.

The attacker first approves the maximum value of the vulnerable contract (0xDE1E704d), and then calls the burnFrom function to input amount=0, that is, directly makes the vulnerable contract (0xDE1E704d) approve the maximum value of the attack contract.

Then directly call the tranferFrom function to transfer 1.1 million DEI to your own address, and finally exchange it into USD through the pair transaction to complete the attack

Vulnerability Summary:

The root cause of this incident lies in a contract vulnerability (RouteProcessor2) related to the invocation permissions of the burnFrom function or a potential error in the _allowance parameter. It is necessary to make modifications based on the actual business requirements of the project. This can be addressed by setting appropriate administrative permissions for burnFrom or by adjusting the _allowance[_msgSender()][account] to _allowance[account][_msgSender()] or similar approaches for fixing the issue.

Security Recommendations:

In light of the recent attack incident, it is important to adhere to the following considerations during the development process:

1. Exercise caution and ensure the rigor of business logic when developing functions related to assets.

2. The vulnerable burnFrom function was introduced during a contract upgrade conducted by the project team on April 16. Therefore, before deploying or upgrading contracts, it is crucial for projects to undergo contract audits by professional third-party auditing teams.

About us

SharkTeam’s vision is to comprehensively protect the security of the Web3 world. The team is composed of experienced security professionals and senior researchers from all over the world. They are proficient in the underlying theory of blockchain and smart contracts, and provide services including smart contract auditing, on-chain analysis, and emergency response. It has established long-term cooperative relationships with key players in various fields of the blockchain ecosystem, such as Polkadot, Moonbeam, polygon, OKC, Huobi Global, imToken, ChainIDE, etc.Official
 website: https://www.sharkteam.org/
Twitter: https://twitter.com/sharkteamorg
Discord: https://discord.gg/jGH9xXCjDZ
Telegram: https://t.me/sharkteamorg

Comments

All Comments

Recommended for you

  • Crypto VC market hits 12-month high in March, with total investment exceeding $1 billion

    According to data from Cointelegraph, the cryptocurrency venture capital market continued to recover in March and April 2024. In March, 161 individual transactions were completed, setting a record in the past 12 months, with a total investment of more than $1 billion, an increase of 52% from the previous month. Although April has not yet ended, as of now, 90 transactions have been completed, attracting more than $820 million in investment.

  • Ethereum Layer 2 TVL has reached $39 billion

    L2BEAT data shows that Ethereum Layer2 TVL has reached $39 billion, with a 7-day increase of 6.66%.

  • Caixin: Mainland investors are currently not allowed to participate in the trading of Hong Kong virtual asset spot ETFs

    According to Caixin, the first batch of six virtual asset spot ETFs issued by Boshi International, Huaxia Fund (Hong Kong), and Jiashi International has been officially approved by the Hong Kong Securities Regulatory Commission. The goal is to be listed on April 30, 2024. It should be noted that mainland Chinese investors are currently not able to participate in the trading of these ETFs, despite the fact that they are first issued by Hong Kong companies under the umbrella of Chinese public funds.According to the product list on the Hong Kong Securities Regulatory Commission website, these six virtual asset spot ETFs were officially approved on April 23, 2024. The products are as follows: Jiashi Bitcoin Spot ETF (03439.HK), Jiashi Ethereum Spot ETF (03179.HK), Huaxia Bitcoin ETF (03042.HK), Huaxia Ethereum ETF (03046.HK), Boshi HashKey Bitcoin ETF (03008.HK), and Boshi HashKey Ethereum ETF (03009.HK).

  • Another person involved in the OneCoin scheme was arrested and the US prosecutors have filed a lawsuit against him

    According to court documents submitted by the Southern District of New York, William Morro, a person involved in OneCoin, has been arrested. Prosecutors said Morro lied to banks about the source of funds to conceal the source of funds related to OneCoin. He was involved in transferring $35 million related to OneCoin to an account in Hong Kong and about $6 million to an account in the United States.

  • Samourai Wallet crypto-currency mixing service co-founder arrested for money laundering

    According to The Block, the co-founders of the encrypted coin-mixing service, Samourai Wallet, have been arrested. Prosecutors allege that they laundered $100 million from Silk Road and other illegal markets. On Wednesday, Samourai CEO Keonne Rodriguez and CTO William Lonergan Hill were charged with operating the Samourai wallet.Prosecutors claim that Samourai is an unlicensed money transfer company that participated in "over $2 billion in illegal transactions and provided over $100 million in money laundering transactions for illegal dark web markets, including Silk Road." Rodriguez was arrested on Wednesday morning and will face trial in Pennsylvania.Hill was reportedly arrested in Portugal, and the US is seeking extradition. Prosecutors say that Samourai's network servers and domain name have also been seized, and the app can no longer be downloaded from the US Google Play store. Rodriguez and Hill are charged with money laundering and unlicensed money transmission, with maximum sentences of 20 years and 5 years, respectively.

  • Rune token DOG's transaction volume exceeded 100 BTC within 4 hours of launch

    According to data from Ordinal News forwarded by Runestone founder Leonidas, the Bitcoin symbol token DOG broke through a trading volume of 118.72 BTC (approximately $7,685,101 USD) within 4 hours of trading. The trading volume on three platforms was: Magic Eden on Bitcoin: 45.21 BTC; OKX Wallet: 20.37 BTC; UniSat: 53.14 BTC.

  • NFT lending volume exceeds $2 billion in Q1

    According to a report from CoinGecko, the first quarter trading volume of the lending market using non-fungible tokens (NFTs) as collateral exceeded $2 billion, a 44% increase compared to the fourth quarter of 2023. The lending platform Blend has shown significant dominance in the market, with a monthly loan amount of $562.3 million as of March 2024, occupying nearly 93% of the market share.

  • Grayscale GBTC outflow of $130 million yesterday

    According to data monitored by HODL15Capital, Grayscale's Bitcoin ETF GBTC saw an outflow of 2,000 BTC, worth about $130 million, on April 24th.

  • U.S. House of Representatives: Agreement on stablecoin regulation will soon be reached with the Chairman of the Financial Services Committee

    Maxine Waters, the Democratic leader of the US Financial Services Committee, predicted on Wednesday that she and Chairman Patrick McHenry will soon reach an agreement on stablecoin regulation legislation.

  • Shanghai Municipal Party Committee Secretary: Welcome Standard Chartered to establish more new institutions, new businesses and new platforms such as blockchain in Shanghai

    Chen Jinong, the Secretary of the Shanghai Municipal Party Committee, met with Weihao Si, the Chairman of the Board of Directors of Standard Chartered Bank, and Mark William D'Arcy, the Executive Director, and some members of the Board of Directors yesterday morning. Chen Jinong stated that he welcomes Standard Chartered Bank to leverage its own advantages, strengthen strategic connections, place more new institutions, businesses, and platforms such as wealth management and blockchain in Shanghai, focus on deepening pragmatic cooperation in technology finance, green finance, digital finance, and create more application scenarios, and provide comprehensive and professional service support for enterprises to go abroad.