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

  • Ripple Prime Launches Perpetual Contract Trading Services for Institutional Clients

    According to Bloomberg, Ripple's main brokerage division, Ripple Prime, is launching perpetual contracts for real-world assets (RWA) aimed at institutional clients, covering over 100 reference markets including stocks, indices, ETFs, and commodities. This product is offered through Trade.xyz on Hyperliquid, continuing Ripple Prime's previous initiative to provide clients with access to cryptocurrency perpetual contract trading.

  • NYC Comptroller Urges Anthropic to Pause IPO Plans

    On October 15, New York City Comptroller Mark Levine stated in an interview that he has written to Anthropic CEO Dario Amodei, urging the company to suspend its planned initial public offering (IPO). In the letter, he called for Anthropic to pause its IPO plans until it can fully and transparently address concerns related to AI safety, governance, and development that the company itself has raised. Levine wrote that the company should focus on mitigating these risks rather than advancing the IPO. Currently, New York City has an investment exposure of less than $10 million in Anthropic through the private market.

  • US September PPI Rises 6.3% Year-on-Year, Exceeding Market Expectations

    The US Producer Price Index (PPI) for September recorded a year-on-year increase of 6.3%, the highest since May 2026, surpassing market expectations of 5.3%. The month-on-month PPI for September was reported at 1.3%, significantly higher than the market forecast of 0.5%. Additionally, US retail sales for September showed a month-on-month increase of 0.8%, also exceeding market expectations.

  • U.S. Initial Jobless Claims at 199,000 Last Week, Expected 200,000

    On October 15, the number of initial jobless claims in the U.S. last week was 199,000, expected to be 200,000, with the previous value revised from 197,000 to 198,000.

  • NYC Comptroller Urges Anthropic to Pause IPO Plans

    On October 15, New York City Comptroller Mark Levine stated in an interview that he has written to Anthropic CEO Dario Amodei, urging the company to pause its planned initial public offering (IPO). The letter calls for Anthropic to suspend its IPO plans until it can comprehensively and transparently address concerns related to AI safety, governance, and development that the company itself has raised. Levine wrote that the company should focus on mitigating these risks rather than moving forward with the IPO. Currently, New York City has an investment exposure of less than $10 million in Anthropic through the private market.

  • BTC Falls Below $81,000

    Market data shows that BTC has fallen below $81,000, currently priced at $80,997.1, with a 24-hour decline of 2.84%. The market is experiencing significant volatility, so please ensure proper risk management.

  • FTC Requests Documents from Anthropic and OpenAI

    On October 15, according to Axios: The U.S. Federal Trade Commission (FTC) has requested documents related to the incident from Anthropic and OpenAI. The FTC issued a civil subpoena to the AI companies on Wednesday.

  • Cook: Apple AI Approved in China, Testing Version Launching Late October

    On October 15, Apple CEO Tim Cook revealed in an interview in Shanghai that Apple AI has been approved in China. A testing version will be launched later in October, featuring initial functions such as real-time translation, writing assistance, and image removal, while Siri AI will not be included.

  • UBS: Fed Expected to Raise Rates for the Third Time in March 2027

    On October 15, UBS stated that it expects the Federal Reserve to implement its third rate hike in March 2027, revising its previous forecast that the rate hike cycle would conclude in December.

  • BTC Surpasses $81,000

    Market data shows that BTC has surpassed $81,000, currently priced at $81,002, with a 24-hour decline of 2.94%. The market is experiencing significant volatility, so please ensure proper risk management.