Backtesting Web3 Exploits: Could Aegis SpotTornado Cash Attack and Ordinals Finance Rug Pull?

Lossless
4 min readSep 22, 2023

--

Looking back on some of the most infamous Web3 attacks and rug pulls, it is easy to get lost in the technical details. One almost forgets about the very real impact on project communities, which ultimately bear the brunt of the associated financial loss.

This is particularly true for the $2m attack on Tornado Cash governance and the $1m rug pull by Ordinals Finance. Communities that took pride in investing according to the principles of DYOR (Do Your Own Research) were scammed out of their hard-earned savings. Could active community members have done anything themselves to protect their assets?

This is the third installment of the Backtesting article series, exploring whether Aegis could have protected projects against past Web3 attacks. Lossless developers backtested our proprietary threat monitoring system against 20 infamous exploits with $727m in total value stolen. They found that Aegis, on average, would have issued an advanced warning 1.23 days prior.

This article focuses on the hijacking of Tornado Cash governance and the Ordinals Finance rug pull, which fall within the “days” category based on the average reaction time window provided by Aegis. See our previous articles for exploits in the “hours” and “minutes” categories.

Key Takeaways

Although automated threat monitoring systems for malicious exploits are frequently advertised exclusively for project teams, active community members could have used Lossless Aegis to conduct their own due diligence.

Aegis first detected the $2m attack on Tornado Cash governance more than 7 days prior. Although the unique exploit was carried out within governance rules, the community did not dig deep into the fine print of the malicious proposal.

The $1m rug pull carried out by Ordinals Finance was first identified by Aegis 6 days and 19 hours before. Had the community members subscribed to Aegis, they would have been alerted about the project team’s preparation for the rug.

Anatomy of Tornado Cash Governance Hack

Last May, a trojan horse proposal took the entire Tornado Cash governance hostage. Copying the logic of a previously-passed proposal, the attacker managed to get community members to vote it through again. This time, however, the malicious proposal included an additional function that ultimately was used to grant control of the entire DAO to a single address.

Attack tx: 0x3274b6090685b842aca80b304a4dcee0f61ef8b6afee10b7c7533c32fb75486d

Though the malicious proposal appeared to mirror the logic of a prior proposal for penalizing specific “cheating” relayers, it had an additional function enabling the attacker to selfDestruct the contract. After approval, the selfDestruct function was used to wipe the original code and insert a malicious contract into the same address.

Surprisingly, the exploiter later proposed a reversal of their actions, effectively returning control to the DAO as it originally was. Nevertheless, such metamorphic contract techniques continued to raise concerns in the community, leading some to advocate for the deprecation of the selfDestruct opcode entirely.

Backtesting the incident with Aegis, Lossless developers found that anomalies would have been spotted 7 days and 2 minutes before it was too late. Our automated threat monitoring system could have identified the malicious intent of the trojan horse proposal and aided the community’s due diligence process. Furthermore, had $TORN been integrated with the core protocol, perhaps through LSS integration or by wrapping in wLSS, the stolen tokens could have been returned to their legitimate owners much faster.

Anatomy of Ordinals Finance Rug

The Ordinals Finance exit scam was reported on April 24. CertiK was the first to raise the alarm after the protocol’s developer withdrew 256m $OFI tokens using a “safuToken” function and another 13m through the “ownerRewithdraw” function. After deleting their social media pages, the team behind Ordinals Finance made out with at least $1m in stolen funds.

Attack tx: 0x50d01f5e553b59d44a6f784c9f3e389bdd34972f4d35fab76bf3a57a6c713294

Centralized withdrawal functions like safuTokens are usually portrayed as safety measures against contract issues, facilitating token recovery before potential theft or permanent loss. Nevertheless, these functions are also frequently misused in rug pulls — a red flag that has been picked up by Aegis. Retrospectively analyzing the incident, our developers noted that active community members would have received an early warning 6 days and 19 hours before the exit scam.

Lossless Aegis

Tornado Cash governance attack and Ordinals Finance rug pull were backtested using Aegis, our proprietary smart contract monitoring system that warns project teams of threats before they evolve into harmful exploits. Basic monitoring services with real-time alerts are available without integration. Users can simply register on the platform and add their smart contract addresses to the watchlist.

Aegis is the optimal choice for monitoring mission-critical smart contracts with high levels of activity and substantial transaction volumes. Aegis screens all mined block transactions using predictive analytics, raising flags on dubious transactions and their related addresses based on severity. Projects can opt for code integration to unlock more advanced firewall-like capabilities that autonomously block exploits and prevent known malicious actors from interacting with your smart contracts.

More information about Aegis can be found at aegis.lossless.io

--

--

Lossless

World’s first unrivalled exploit identification and mitigation tools, designed to foolproof web3 from malicious activity.