Punk Protocol Hack - August 10, 2021
Summary
A DeFi annuity protocol suffered a security breach resulting in $8.95M in losses, with approximately $5M recovered through whitehat intervention.
What Happened
On August 10, 2021, Punk Protocol was compromised. The platform intended to offer DeFi annuity products backed by ETH, WBTC, and stablecoins. An attacker exploited a smart contract vulnerability to drain funds from three stablecoin pools (USDC, DAI, USDT) designed for a fair launch campaign carrying $3M in deposits.
A vigilant whitehat operator frontran the malicious transactions and intercepted most assets, negotiating the return of approximately $5M in exchange for a $1M bounty.
Technical Root Cause
The Punk team identified "a missing Modifier in the initialize() function within the CompoundModel code." Specifically, the initialize() function lacked an "initializer" Modifier, allowing unauthorized initialization and manipulation of critical contract parameters.
Attack Vector
Exploit Steps:
1. Attacker used delegateCall() to invoke the unprotected initialize() function
2. Function parameters were manipulated to replace the legitimate forgeAddress with the attacker's malicious contract
3. With the malicious contract now registered as the authorized forge address, the attacker called withdrawToForge
4. The OnlyForge Modifier validated the malicious contract as legitimate, permitting asset transfers
5. USDC was swapped to ETH via 1inch and laundered through Tornado Cash in 100 ETH increments
Key Transactions:
Original attack: 0x7604c7dd6e9bcdba8bac277f1f8e7c1e4c6bb57afd4ddf6a16f629e8495a0281
Whitehat frontrun: 0x597d11c05563611cb4ad4ed4c57ca53bbe3b7d3fefc37d1ef0724ad58904742b
USDC to ETH swap: 0x60c0757b82e82c9bb3e658d2d5a49e94630d04eb1bd735077ffed4e60e2403b5
Financial Impact
AssetAmountStatus
USDC~$3MStolen, partially converted to ETH
DAI~$1.95MRecovered
USDT~$3MRecovered
Total Loss$8.95M
Attacker Retained~$1M16% of stolen amount
Recovered Funds~$5MDesignated for user compensation
Attacker wallet: 0x1d5a56402425c1099497c1ad715a6b56aaccb72b
Malicious contract: 0x1695ce70da4521cb94dea036e6ebcf1e8a073ee6
Recovered funds address: 0xec36e96739b0fe73f5d078952850d1fc608e7652
Remediation
Punk Protocol indicated plans to:
• Release an update addressing the vulnerability within days
• Distribute recovered funds ($5M) toward user compensation
• Continue recovery efforts with the original attacker
The core fix required adding the missing "initializer" Modifier to prevent unauthorized function execution.