Back to blog

The SushiSwap Hack Explained & The Anti-Theft Tool We Needed

5 min read

The SushiSwap hack, which resulted in a loss of $3.3 million, highlights the importance of taking protective measures in the world of cryptocurrency. We offer a deep dive into the mechanics of the attack and how FailSafe, our anti-theft tool for cryptocurrency wallets, would have stopped hackers from stealing millions in digital assets.

In this analysis, we delve into the technical intricacies of the hack, assess its impact on users and the broader crypto community, and introduce FailSafe as the anti-theft tool designed to prevent such breaches.

Vulnerability & Root Cause

The RouteProcessor2 contract, introduced in SushiSwap only 4 days before the attack, was a fresh vault with a hidden vulnerability.

The flaw was its verification of the ‘digital keys’ — the pairAddresses used for trading tokens. While the system was designed to verify these addresses during trades, it was not foolproof. Here’s a breakdown of the exploit:

  1. Choosing the PairAddress: Users select a specific pairAddress for token trading.
  2. System Verification: The system checks if the chosen pairAddress is legitimate for each trade.
  3. Security Flaw: Attackers can create a fake smart contract pretending to be the pairAddress and trick the system. By doing this, attackers can steal tokens from users who have approved the trading process to happen.

Once this fake contract, or ‘counterfeit key’, was accepted by the system, the hackers gained the ability to reroute funds from any user who had previously given transactional permissions to the contract.

This vulnerability turned a seemingly secure vault into an open treasure for the hackers, allowing them to siphon off user assets with ease.

User Impact

The most impacted was a user known as sifuvision.eth, who lost a staggering 1,800 ETH due to the exploit. The approval allowed SushiSwap to access an unlimited amount of their funds, detailed here.

The attacker exploited the vulnerability in the SushiSwap smart contract and stole the funds from sifuvision.eth’s wallet, detailed here.

The exploited vulnerability: the setting detailed in row 315 of RouteProcessor2.sol smart contract allowed the attacker to gain access.

SushiSwap’s Response to the Hack

Following the detection of the hack, SushiSwap’s team and the DeFi community quickly mobilized to mitigate the damage. The team deployed measures to halt further unauthorized transactions and initiated an investigation to trace the stolen funds.

Collaborative Effort: The resolution involved collaboration with blockchain analysts, security experts, and the wider crypto community.

Recovery Actions: Efforts were made to recover the stolen funds, including tracing the movement of assets and collaborating with other platforms to freeze and recover assets where possible.

System Upgrades: SushiSwap implemented immediate upgrades to the RouteProcessor2 contract to prevent similar attacks in the future and reassured its users by enhancing overall platform security.

Aftermath and Industry Response

Although the immediate financial impact was relatively contained, the SUSHI token saw a modest 6% drop in value, reflecting a cautious response from investors. More significantly, this incident highlighted the need for improved security measures across DeFi.

Industry Leader Insights: Prominent figures in the crypto world, such as Adam Cochran and Rick McCracken expressed their concerns, with many stressing the urgency of integrating more sophisticated security tools.

FailSafe’s Alignment: In response to these industry shifts, FailSafe has positioned itself at the forefront of DeFi security, aligning with emerging standards and exceeding expectations.

How FailSafe Could Have Stopped the SushiSwap Hack

FailSafe’s architecture is designed to address precisely the type of vulnerability that led to the SushiSwap hack. Key features include:

  1. Real-time monitoring: FailSafe’s real-time monitoring system keeps a close watch on all pre-chain activity – when a malicious transaction surfaces, the FailSafe interceptor service is activated.
  2. Swift intervention: Upon detecting a suspicious transaction, FailSafe would have swiftly intercepted them, halting the transfer of funds to the hackers’ addresses. This prompt intervention would have prevented the theft from taking place, saving users’ funds and preserving the platform’s reputation.
  3. Secure movement of digital assets: Once the fraudulent transactions were intercepted, FailSafe would have safely transferred the targeted digital assets to a safe wallet. This would have ensured the funds remained out of reach of the hackers and kept in the possession of their rightful owners.

In this alternate reality, the SushiSwap hack is averted, assets remain secure, and user confidence in the platform remains intact.

Lessons Learned and Industry Best Practices

The SushiSwap hack underscores several critical lessons for the DeFi sector:

  • The Importance of Rigorous Contract Auditing: Before implementing new contracts, thorough auditing is essential to identify and fix potential vulnerabilities.
  • User Vigilance: Users should regularly review and understand the permissions they grant on DeFi platforms.

Best Practices in DeFi Security:

  • Regular Security Audits: Continuous auditing of smart contracts to identify and address vulnerabilities.
  • Enhanced User Education: Providing users with the knowledge to understand the risks and best practices in DeFi.

FailSafe embodies these lessons through its comprehensive security approach, incorporating continuous monitoring, advanced threat detection, and user education initiatives.

This combination of technology and user empowerment makes FailSafe a guardian in the evolving landscape of DeFi security.

Securing Your DeFi Future

As threats in the DeFi landscape continue to evolve, so does the need for innovative and adaptive security solutions. Embracing these practices and technologies is not just a choice but a necessity for anyone venturing into the digital asset space.

Sign up to FailSafe for free and start protecting your digital assets against hacks today.

Ready to secure your project?

Get in touch with our security experts for a comprehensive audit.

Contact Us