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

  • Cointime May 12 News Express

    1.The number of Bittensor subnets for the AI ​​project will increase to 64, and 1024 subnets will be achieved this year2.Trader predicts Bitcoin price will reach $350,0003.vladilena.eth redeemed 1930 weETH from Zircult, suspected of selling4.Solana’s on-chain DEX transaction volume yesterday exceeded the sum of five chains including Ethereum, BSC, and Arbitrum5.RSS3 VSL locked-in amount surged in the past two days and is close to 200 million US dollars 6.The transaction volume of Club Key on friend.tech platform exceeded 1 million7.Lido has paid out more than 516,000 ETH in staking rewards, equivalent to approximately $1.51 billion8.1,000 BTC transferred from TronDAO to an unknown new wallet9.Report: Justin Sun deposited 120,000 eETH into Swell L2, worth $376 million10.1707.36 BTC have flowed out of Binance in the past 7 days

  • Interpol Nigeria boosts cybersecurity with virtual asset training

    The training will enable officers to effectively address cybercrimes involving virtual assets, particularly stablecoins.

  • JPMorgan’s Onyx to industrialize blockchain PoCs from Project Guardian

    Traditional firms like JPMorgan and WisdomTree are seeking to turn Project Guardian’s blockchain proofs-of-concept into scalable financial products.

  • Franklin Templeton CEO says all ETFs and mutual funds will be on blockchain

    She also warned that generative artificial intelligence was like the “kid that got an ‘F’ in math.”

  • OKX Ventures invests in Web3 ‘play ARPG to train AI’ game Blade of God X

    The game is currently available in early access on the Epic Games Store.

  • Bitcoin volatility plunges below Tesla, Nvidia stocks amid $100K price prediction

    Lower Bitcoin market volatility often precedes significant bull runs, suggesting that the current trend could propel prices toward the $100,000 to $150,000 range.

  • Xinjiang launches special campaign to combat illegal fundraising, with key areas including virtual currency, blockchain, etc.

    According to Chang'an Xinjiang Public Account, Xinjiang Autonomous Region and Corps have launched a joint special action to crack down on illegal fund-raising, with key areas including third-party wealth management, fake private equity, fake gold exchange and other traditional fields, as well as emerging fields such as virtual currency, blockchain, cultural tourism, film and television investment, and debt resolution services. It is reported that key cases include cases involving more than 100 million yuan and cases that have been criminally filed for more than five years.

  • A British court has postponed the final sentencing of Wen Jian, a British-Chinese national involved in the country's largest Bitcoin money laundering case, until May 24.

    On May 11th, it was reported that Jian Wen, a 42-year-old British Chinese citizen, was found guilty of "participating in arranging money laundering" in the UK's largest Bitcoin money laundering case. He could be sentenced to up to 14 years in prison. Jian Wen's defense lawyer, Mark Harries, stated that due to the judge's busy schedule, the UK court has postponed Jian Wen's final sentencing, which was originally scheduled for May 10th, to May 24th.

  • Web3 startup Star Nest completes $6 million in Pre-A round of financing

    Hong Kong Web3 music startup Star Nest announced that it has completed a $6 million Pre-A round of financing, led by Chuangqi International Limited, a wholly-owned subsidiary of Hong Kong Stock Exchange-listed company Guofu Innovation. Star Nest will collaborate with Armonia Meta Chain to develop the Star Nest SpaceStar metaverse game, which includes music, role-playing, and social features.In addition, Star Nest plans to launch its NEST project in the third quarter of 2024. Nest will receive 2.1 billion NEST tokens tailored for the project, and Star Nest will use the NEST token to build a more complete music industry token economic system. The NEST token will be widely used for purchasing performance tickets, chain game cooperation, metaverse consumption, governance voting, and other activities.

  • Over $594 million worth of PYTH is staked

    According to Dune data,  there are currently 1,201,167,362 PYTH tokens in the staked state, with a total staked value exceeding $594 million. The number of PYTH stakers has reached 151,211.