# Unverified Polygon swap: fake pair callback drains DAI

Unverified Polygon contract trusted attacker-supplied fake Uniswap V3 pair, whose swap callback forced the victim to transfer 3,131 DAI to the attacker.

- Payout: Real-world hack
- Severity: high
- Program: unverified
- Credited: DeFiHackLabs
- Disclosed: 2025-08-16
- Write-up quality: 6/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2025-08/unverified_d132_exp.sol
- Library page: https://bugbountylibrary.com/r/dhl%3A20250816-unverified-d132
- Tags: domain:web3 impact:funds-loss kind:incident platform:defihacklabs sev:high tech:evm tech:solidity technique:source-review vuln:access-control vuln:business-logic

**Target:** Uniswap V3-like swap entrypoint on Polygon
**Root cause:** The victim's swapSingleToken accepted an arbitrary pair address and invoked pair.swap, then paid DAI in uniswapV3SwapCallback without authenticating that the pair was a real pool or that the callback data was legitimate.
**Steps:**
1. Deploy FakeToken and FakePair controlled by attacker.
2. Call `swapSingleToken(fakePair, attacker, fakeToken, false, 1 ether)` on victim `0xd132B6e4CdB57E8E992C9b968CD4CcdDE3B0bafF`.
3. Victim calls `fakePair.swap(...)`; FakePair reads victim's DAI balance and calls `uniswapV3SwapCallback(victimDaiBalance, -amountSpecified, abi.encode(DAI))` on the victim.
4. Victim's callback transfers DAI to the fake pair (msg.sender).
5. FakePair transfers received DAI to attacker `0xe4B97Db5FAF476DB464Bc271097Fac97d6CE3783`.
**How found:** Likely identified an unverified contract exposing a swap function that accepts an arbitrary pair address and pays tokens in a callback without validating the pair against a factory or checking pool authenticity.
**Exploitation:** Attacker deployed a fake ERC20 and a fake Uniswap V3-like pair, approved the fake token to the victim, and invoked the victim's swap entrypoint with the fake pair. The fake pair's swap function called back into the victim's uniswapV3SwapCallback, which paid out real Polygon DAI to the fake pair; the fake pair forwarded the DAI to the attacker. No capital or flash loan required.
**Insight:** When a contract accepts a caller-supplied pair/pool address and then pays tokens inside a swap callback, test whether a fake pair can drive the callback to extract real funds; always verify the pair is canonical (factory-derived) before transferring value.
