Input Validation? More Like 'Input Vandalism' – How $17M Went Poof in Two DeFi Oopsies
Back to feed

Input Validation? More Like 'Input Vandalism' – How $17M Went Poof in Two DeFi Oopsies

By our DeFi Desk3 min read

BlockSec's on-chain detectives have just finished their autopsy on a pair of DeFi exploits that vaporized a cool $17 million. The headline act was a $13.4 million vanishing act from DEX aggregator SwapNet, with a $3.67 million warm-up act courtesy of Aperture Finance.

The post-mortem, according to BlockSec, points to a classic 'arbitrary-call capability due to insufficient input validation.' For the degens in the back, that translates to the contracts having a 'trust me, bro' mode that hackers promptly used to loot every approved token in sight.

The SwapNet debacle hinged on a single, overly trusting function, 0x87395540(), which failed to ask for ID. Attackers slid in token addresses (think USDC) where router addresses should have been, essentially handing them the keys to make the contract execute their own malicious low-level calls and drain the vault.

The casualties were mostly Matcha Meta users who had decided that 'One-Time Approval' was for cowards and instead granted infinite approvals directly to SwapNet. One particularly unfortunate bagholder watched roughly $13.34 million disappear into the mempool. In total, 20 users got absolutely rekt.

The heist began on Base. SwapNet hit the pause button there 45 minutes after catching on, but that was just enough time for the attacker to go on a multi-chain shopping spree, bagging 13 more victims across Ethereum, Arbitrum, and Binance Smart Chain while the devs scrambled.

Not to be outdone, Aperture Finance, a concentrated liquidity manager, tripped over the exact same genre of flaw in its function 0x67b34120(). An internal function blindly executed whatever calldata users fed it, letting attackers cook up calls to siphon ERC-20 tokens and even approve away their Uniswap V3 NFTs.

Anyone who had approved Aperture's 'Instant Liquidity Management' features found their wallets on the menu. In a move of pure efficiency, one exploit transaction spent a laughable 100 wei of ETH to trigger a call that drained approved WBTC—talk about a high ROI.

In the predictable aftermath, both protocols are now loudly preaching the gospel of 'revoke your approvals,' pointing users to tools like Revoke.cash. Matcha Meta has disabled the toggle to bypass One-Time Approval and shown SwapNet the door, publicly swearing off their former 'customizability over security' aesthetic.

Aperture Finance has pulled the plug on all affected web app functions. They're now playing detective with forensic firms and law enforcement, trying to trace the funds and have opened the classic 'negotiation' channels for a possible return. The final lesson, per BlockSec: when your smart contract is a black box, flexibility needs to come with iron-clad call constraints, unless you enjoy watching money go poof.

Mentioned Coins

$USDC$ETH$WBTC$UNI
Share:
Keep Reading

Related Articles

View all
Publishercryptonewsroom.xyz
AuthorDeFi Desk
Published
Updated

Disclaimer: This content is for information and entertainment purposes only. It does not constitute financial, investment, legal, or tax advice. Always do your own research and consult with qualified professionals before making any financial decisions.

See our Terms of Service, Privacy Policy, and Editorial Policy.