Cointime

Download App
iOS & Android

Decoding SafeMoon Protocol’s $8.9 million Exploit | QuillAudits

Validated Project

Someone found an “easy peasy” vulnerability in the Safemoon token pair and made off with almost 9 million dollars.

No big deal, right? Just another reminder to double-check your smart contract security before you lose millions of dollars.

Summary:

On March 28, 2023, an attacker exploited an access control vulnerability in the burn() function of the Safemoon smart contract. The vulnerability was introduced when the SafeMoon Deployer address upgraded the token contract to a new implementation. The attack resulted in a loss of around 8.9 million.

About Safemoon:

The Safemoon protocol is a decentralized finance (DeFi) platform built on the Binance Smart Chain. It aims to provide a safe and secure platform for users to trade and hold cryptocurrencies. The platform includes features such as static rewards, automatic LP (liquidity provider) acquisition, and a token burn mechanism.

On-Chain Details:

MEV Bot Address: 0x286e09932b8d096cba3423d12965042736b8f850

Attacker EOA: 0x97226254fF489f3257E68222F184Ac2b6E20A4ff

Safemoon Deployer’s EOA: 0x678ee23173dce625a90ed651e91ca5138149f590

Original attack txn (failed): 0xbcf5e30c164837b5d7c42fd7e33e47a0072dc014e7f0a67aa7710af49d0ce53b

MEV Bot Attack txn: 0x48e52a12cb297354a2a1c54cbc897cf3772328e7e71f51c9889bb8c5e533a934

Root Cause:

The root cause of the attack was that during an upgrade of the Safe Moon contract, an access control vulnerability was introduced in the burn function. This vulnerability allowed an attacker to burn tokens from any address. Vulnerable code can be found here.

How did the attack occur?

  • The attacker started by purchasing around 102 WBNB tokens before exchanging them for their SFM pair counterpart.
  • Now that the burn() function was public, the attacker then burned a huge number of SFM tokens, inflating the price of SFM tokens.
  • Finally, the attacker converted the SFM tokens to their WBNB counterpart and withdrew around $8.9 million in tokens, resulting in a massive loss for SafeMoon users.

The Story Turns:

An MEV bot front-ran the original attack transaction. The same MEV bot was involved in the Nuwa Exploiter and DBALL Exploiter hacks.

After the Exploit:

The team announced the attack on their Twitter account. They further stated that it had affected the SFM:BNB LP pool, but the DEX was safe.

Mar-29–2023: The exploiter has indicated that they are currently waiting for a secure communication channel in order to return the funds to the team in a transaction.

Mar-30–2023: Safemoon Replied that the attacker can return funds to Safemoon's Treasury:

How Could this attack have been prevented?

The project should have conducted a comprehensive audit and double-checked the security of your smart contract. To minimize DeFi protocol attacks, implement strict security standards, despite imperfect measures. Third-party auditors must routinely assess smart contracts, identify vulnerabilities, and propose mitigation plans.

Read more: https://medium.com/coinmonks/decoding-safemoon-protocols-8-9-million-exploit-quillaudits-a5b11417f0b9

Comments

All Comments

Recommended for you

  • Contango Blockchain x AI Fund Completes $5 Million Fundraising

    Contango Digital Assets, a portfolio under Orthogonal Global Group, announced that its blockchain and AI seed fund, Contango Blockchain x AI Fund, has completed a fundraising of $5 million. Investors include the CEO of Quantstamp, the CFO of SingularityNet, the CEO of WonderFi, a general partner of X Ventures, early limited partners of Digital Money Group and Polychain Capital, as well as investors of VANTA DAO. It is reported that the fundraising goal of the fund is $10 million, and it will focus on supporting projects in the decentralized artificial intelligence field in the future. Currently, it has purchased tokens of the telecommunications sharing economy project Minutes Network.

  • SEC v. Ripple case progress: SEC will submit a public redacted version of the remedy response brief and supporting evidence by Wednesday

    Former US federal prosecutor James K. Filan shared the latest developments in the SEC's lawsuit against Ripple on X platform. The SEC has submitted sealed documents, including its response brief and supporting evidence for its remedies. These documents have not been made public yet. The revised public version will be submitted before Wednesday, May 8th. Other sealed documents will be submitted later.

  • LayerZero: Working with Nansen and others to write a Sybil Detection Report

    LayerZero Labs announced that it has been working with Chaos Labs and Nansen to compile a witch detection report. They will consider the total weighted transactions of each user in all LayerZero applications to ensure consistency between TGE, developers, and long-term users. The report will be released after the deadline for self-reporting witches.

  • Ethereum network gas fee drops to 4 gwei

    According to Etherscan data, the current gas fee on the Ethereum network has dropped to 4 gwei.

  • Yesterday, Grayscale GBTC had a net inflow of US$4 million, achieving net inflows for two consecutive days

    According to HODL15Capital monitoring, the trading volume data for Bitcoin spot ETF on May 6th is as follows: BlackRock IBIT 932 million US dollars, Grayscale GBTC 365 million US dollars, Fidelity FBTC 297 million US dollars, ARKB 66.08 million US dollars, BITB 52.4 million US dollars.

  • Asset Manager Hightower Buys $68 Million Worth of Bitcoin Spot ETF

    According to Watcher.Guru, asset management company Hightower with a management scale of 130 billion US dollars disclosed in an SEC filing that it has purchased a Bitcoin spot ETF worth 68 million US dollars.The company holds positions in 6 Bitcoin spot ETFs, specifically:Grayscale BTC: 44,838,000 US dollars (709,956 shares)Fidelity Bitcoin ETF: 12,410,000 US dollars (200,084 shares)BlackRock Bitcoin ETF: 7,621,000 US dollars (188,397 shares)ARK Bitcoin ETF: 1,702,000 US dollars (23,964 shares)Bitwise Bitcoin ETF: 988,000 US dollars (25,449 shares)Franklin Templeton Bitcoin ETF: 788,000 US dollars (19,129 shares)

  • 9 spot Bitcoin ETFs increased their holdings by a total of 3,710 Bitcoins on May 6

    Lookonchain monitoring data on May 6th showed that Fidelity added 1662 Bitcoins, worth about 105.7 million US dollars, and currently holds 151,241 Bitcoins, worth about 9.62 billion US dollars; Grayscale GBTC reduced holdings by 938 Bitcoins, worth about 59.66 million US dollars, and currently holds 291,239 Bitcoins, worth about 18.53 billion US dollars; 9 Bitcoin ETFs collectively added 3710 Bitcoins, worth about 236 million US dollars.

  • German state-owned development bank KfW plans to issue blockchain digital bonds with a minimum size of 100 million euros

    Germany's state-owned development bank Kredittanstalt fuer Wiederaufbau (KfW) plans to issue a blockchain digital bond with a minimum size of 100 million euros. Insiders revealed that the bond is expected to mature on December 31, 2025. KfW is reportedly in discussions with European institutional investors during the preparation phase over the next few weeks to allow investors time to become familiar with the transaction. The transaction is expected to be completed in the summer.

  • Cryptocurrency venture capital investment hit $1.02 billion in April

    According to Rootdata's data, in April 2024, the cryptocurrency industry attracted $1.02 billion in venture capital funding in 161 rounds of investment. This is the second consecutive month that financing has exceeded the $1 billion mark, bringing the total investment in cryptocurrency companies to $3.67 billion so far in 2024. Blockchain infrastructure companies alone have accumulated more than $1.7 billion in funding this year.

  • The 7-day average of Bitcoin’s hashrate has dropped and is currently slightly above 600 EH/s

    According to data from The Block, since the halving of Bitcoin block rewards, the 7-day moving average of Bitcoin's hash rate has slightly decreased and is currently slightly above 600 EH/s, but still at a historical high.