wDAO EON Hack
What happened
On June 2, 2023, an attacker drained about $29,195 in USDT from a swap contract on Polygon that exchanged USDT for NST (Instante) at a fixed rate. PeckShield flagged the victim as wDAO EON with about $30K lost. DeFiHackLabs calls the same attack "NST Simple Swap" and says the software company Milktech built NST as a token held at a constant USD price. The swap contract offered buyNST and sellNST functions, and its source code was never verified.
DeFiHackLabs files the bug as a wrong approval. After a buy and a sell, the swap contract had left the attacker's contract with a USDT allowance, and the attacker used transferFrom to pull an extra 31,559 USDT out of it. The attacker funded the round trip with a 40,000 USDT Balancer flash loan and repaid it in the same transaction.
The address that collected the profit was not the first to try. Another address sent an attack transaction in the same second and it reverted, which fits reports that the original exploiter was front-run by a bot.
**Block data**
- Attacker (front-runner):
0xcb3585f3e09f0238a3f61838502590a23f15bb5b - Initial attacker:
0xb3d204ee119547faa7be6796a31ca773c24b1fdc - Attack contract:
0x3bb7a0f2fe88aba35408c64f588345481490fe93 - Swap contract:
0x9D101E71064971165Cd801E39c6B07234B65aa88 - Exploit transaction:
0xa1f2377fc6c24d7cd9ca084cafec29e5d5c8442a10aae4e7e304a4fbf548be6d - Failed transaction (initial attacker):
0x0ef500ef64e6921eb80d69dddbcd662eb9c52a2e0e147943a33e2df989fd294d
How it happened
- The attack contract borrowed 40,000 USDT from Balancer V2 in a flash loan.
- It spent the 40,000 USDT on NST through the swap contract's buy function: 38,800 USDT went to the swap contract and 1,200 USDT to a fee address, and it received 388,000 NST.
- It sold the NST back through the sell function and received 37,636 USDT.
- The swap contract had left the attack contract a USDT allowance. The attacker used
transferFromto pull another 31,559.08 USDT out of the swap contract. - It repaid the 40,000 USDT flash loan and sent the remaining 29,195.08 USDT to
0xb8670997...9Eeb. - In the same second, a transaction from
0xb3d2...1fdcto contract0xFF24edb0...reverted, consistent with the original exploiter being front-run.
Protocol details
Evidence
- report @PeckShieldAlert incident report twitter.com
- transaction Polygonscan transaction 0xa1f2377f...be6d polygonscan.com
- transaction Polygonscan transaction 0x0ef500ef...294d polygonscan.com
- address Polygonscan contract 0x9D101E71064971165Cd801E39c6B07234B65aa88 polygonscan.com
- address polygonscan.com address 0x3bb7…fe93 polygonscan.com
- address polygonscan.com address 0xb3d2…1fdc polygonscan.com
- address polygonscan.com address 0xcb35…bb5b polygonscan.com
- code DeFiHackLabs past/2023 README: 20230602 NST Simple Swap - Unverified contract, wrong approval github.com
- code DeFiHackLabs NST_exp.sol proof of concept github.com
- analysis Is MATIC undervalued? New data indicates... (AMBCrypto, June 5, 2023) ambcrypto.com
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.