The $100 million theft of Mango: A dual attack utilizing flash loans and DAO governance
Author: flowie, Chain Catcher
This morning, the Solana ecosystem DeFi project Mango was hacked for about $100 million, marking one of the largest security incidents in the history of the Solana ecosystem. Similar to most DeFi attack events, this incident was carried out through a flash loan attack, where the hacker manipulated the oracle prices to deplete almost all of the protocol's liquidity. However, the situation quickly escalated into a more dramatic and complex scenario, as the hacker initiated an on-chain proposal on the Mango governance platform, which is considered another governance attack on the project.
Who is Mango?
Mango is a decentralized trading and lending protocol that allows users to trade on Solana for spot margin and perpetual futures, managed by the Mango DAO.
Before the attack, Mango's TVL was $104 million, making it the sixth largest DeFi project by TVL in the Solana ecosystem. Additionally, Mango has received strong support from Multicoin. In September last year, Multicoin Capital partner Spencer Applebaum stated that they purchased nearly $10 million worth of MNGO tokens.
Flash Loan Attack
Regarding the hacker's process of arbitraging $100 million, Joshua Lim, head of derivatives at Genesis Global Trading, provided a detailed analysis on Twitter.
Specifically, the hacker had two accounts, A and B, each with $5 million in USDC. Using the $5 million USDC from account A as collateral, the hacker minted 483 million MNGO perpetual contracts on the Mango Markets order book. They then quickly used the $5 million USDC from account B to purchase these 483 million MNGO perpetual contracts at a price of $0.03 each.
Subsequently, the hacker began to manipulate the price of the Mango spot market, pushing the MNGO price from $0.03 to $0.91, resulting in a value of $423 million for the 483 million MNGO. The hacker then used the MNGO from account B as collateral to borrow $116 million in loans. At this point, Mango's liquidity was depleted, with assets such as USDC, MSOL, SOL, BTC, USDT, SRM, and MNGO completely drained, allowing the hacker to profit $100 million.
DAO Governance Manipulation
What started as a common flash loan attack unexpectedly turned into a DAO governance attack , possibly to avoid criminal investigation or asset freezing. The hacker resurfaced to propose that the treasury repay the users for the stolen $100 million, using the stolen governance tokens to manipulate the vote, achieving nearly 100% support.
The specific content of this proposal is to use approximately $70 million USDC from the Mango treasury to repay bad debts. If this proposal is passed in the vote three days later, the hacker will transfer the MSOL, SOL, and MNGO in their account to the address released by the Mango team.
The hacker stated: "All remaining bad debts in the protocol will be repaid by the Mango treasury, and users without bad debts will not be affected. Any bad debts will be treated as a bug bounty/insurance, paid by the Mango insurance fund. If Mango token holders vote in favor of this proposal, it indicates agreement to pay this bounty and use the treasury to repay bad debts, waiving any potential claims against the bad debt accounts. Once the tokens are repaid according to these rules, there will be no criminal investigation or asset freezing."
It is worth mentioning that such DAO governance attacks have become increasingly common. Last year, the attacker of the stablecoin protocol Beanstalk also obtained a loan through a flash loan, and after acquiring a sufficient number of Beanstalk governance tokens, immediately passed a malicious proposal, controlling Beanstalk's $182 million reserve funds.
Additionally, cross-chain stablecoin project True Seigniorage Dollar, BSC lending protocol Venus, and synthetic asset protocol Mirror have all suffered varying degrees of governance attacks.
DAO governance attacks are purely "in-protocol" attacks and are almost impossible to resolve through cryptographic means. For the frequent governance attacks, DAOs may really need to think about how to use mechanism design to prevent and avoid them.
Impact and Response
The attack incident is still unfolding, and protocols affected by the Mango attack are gradually speaking out. The Solana ecosystem algorithmic stablecoin protocol UXD Protocol stated that the total amount of funds affected by the Mango attack has reached nearly $20 million. UXD Protocol has suspended UXD minting to minimize risk, and once the issues with Mango Markets are confirmed to be resolved, the minting function will be re-enabled.
The Solana ecosystem yield aggregator Tulip Protocol reported that approximately $2.5 million in funds were affected by this incident, stating that its exposure in the Mango attack is limited to a portion of the USDC/RAY strategy fund, specifically 2,465,841.497167 USDC and 66,721.925355 RAY. Additionally, Tulip Protocol has temporarily disabled withdrawals from the strategy fund and claims to have sufficient funds to cover losses if necessary.
In response to this attack incident, Mango's current measures are to investigate the cause of the incident and freeze third-party liquidity as a precaution. Furthermore, Mango will disable deposits on the front end, indicating that users can contact via email to discuss bounty for fund recovery; at the same time, users are reminded not to deposit into Mango and encouraged to contact the hacker to "discuss bug bounties."
As for the parties involved in this attack incident, according to Mango's official Twitter, communication has taken place in MangoDAO, and they expressed willingness to negotiate. The next priorities for MangoDAO are: 1. Prevent further unnecessary losses. 2. Ensure that depositors in the Mango protocol are whole. 3. Attempt to salvage some value from the MangoDAO protocol and rebuild.
Currently, the price of MNGO has plummeted. As of the time of publication, the trading price of this asset is $0.02297, with a daily decline of 43.23%.