Thala, a prominent DeFi project on the Aptos blockchain, faced a major exploit in its v1 farming contracts. The attacker exploited a vulnerability in the contract logic to withdraw liquidity pool (LP) tokens fraudulently, leading to a total loss of $25.5M.
Through quick intervention, Thala paused related contracts, froze token assets, and negotiated a $300K bounty for the return of user funds.
Thala is a decentralized finance protocol built on the Aptos blockchain. It offers liquidity provision and staking opportunities through its LP tokens, allowing users to earn rewards. The protocol focuses on farming pools for MOD and THL tokens, catering to the growing Aptos DeFi ecosystem.
Step 1: Funding the Exploit
The attacker funded their account with 10 APT tokens and added liquidity to the MOD/lzUSDC pool, receiving 23 Thala-LP tokens in return.
Later the exploiter removed 13,000 THALA-LP and swapped back to lzUSDC
Step 2: The Exploit
Using a manipulated arg2 (withdraw amount) value of 1E12, the exploiter bypassed checks for the staked amount and effectively received LP tokens they were not entitled to.
Step 3: Draining Pools
The attacker drained the THL/MOD farm and swapped the stolen tokens back into lzUSDC, ultimately converting into 400K APT.
Step 4: Mitigation Efforts
Thala froze related assets, paused the affected contracts, and identified the attacker. The exploiter accepted a $300K bounty and returned 400K APT to the treasury.
The vulnerability stemmed from inadequate parameter validation in the unstake
function of the updated v1 farming contract.
Specifically, the contract failed to ensure that the withdraw amount (arg2
) provided by the user was less than or equal to their actual staked balance.
This oversight allowed the attacker to manipulate the arg2
parameter, essentially tricking the contract into returning a massive amount of LP tokens (1E12) they never staked. The unchecked withdraw logic cascaded into the draining of liquidity pools and farms, amplifying the damage.
Move, the programming language for Aptos, emphasizes resource safety and type safety, but it’s not immune to vulnerabilities.
One significant issue with Move contracts is decompilation risks, which make it easier for attackers to analyze and reverse-engineer bytecode compared to Solidity.
Stronger Parameter Validation
Ensuring the withdraw amount (arg2
) is always checked against the user’s actual staked tokens would have stopped this attack in its tracks.
Audits from Experts
A comprehensive audit from a trusted partner like QuillAudits could have caught this vulnerability before it became a $25.5M disaster.
Bug Bounty Programs
Establishing ongoing bounty programs encourages ethical hackers to report vulnerabilities rather than exploit them.
Secure Contract Design
For Move, consider obfuscation techniques, stricter function constraints, and ensuring all storage operations are rigorously checked.
Automated Monitoring
Integrate real-time tools to detect unusual patterns, like oversized withdraw amounts, and trigger emergency halts.
Move Contracts Aren’t Invincible
While Move introduces advanced safety features, these don’t eliminate vulnerabilities introduced by developer error.
Decompilation Risks Are Real
Unlike Solidity, Move contracts are easier to decompile, exposing project logic to attackers. Teams must account for this with more robust design and security practices.
Don’t Skip Audits
Assuming safety because of a platform’s inherent features is dangerous. Audits are essential, especially for high-stakes protocols.
Choosing a reputable audit firm like QuillAudits ensures that your protocol undergoes rigorous scrutiny
from experienced security professionals. QuillAudits specializes in uncovering critical vulnerabilities and providing actionable remediation strategies. Our expertise helps safeguard your project from attacks, ensuring that security issues are addressed proactively.
Join 1000+ leaders who secured themselves from losing Billion Dollars.
Get Pure Alpha Straight to Your Inbox. Miss this, and you’re missing out.
Insider Secrets - Delivered Right to You. Subscribe now.