# MureDistribution: forged ERC1271 signature drains victim QUEST

MureDistribution trusted attacker-controlled ERC1271 signer, letting anyone forge a distribution to drain 4.8M QUEST from a victim and swap to ~5.45 ETH.

- Payout: Real-world hack
- Severity: high
- Program: MureDistribution
- Credited: DeFiHackLabs
- Disclosed: 2026-05-21
- Write-up quality: 7/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2026-05/MureDistribution_exp.sol
- Library page: https://bugbountylibrary.com/r/dhl%3A20260521-muredistribution
- 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 vuln:signature-replay

**Target:** Ethereum smart contract (distribution proxy with ERC1271 signature verification)
**Root cause:** distribute() accepted an arbitrary `signer` address and validated the signature via that contract's ERC1271 isValidSignature, which the attacker implemented to always return the magic value. No check that signer was an authorized Mure signer.
**Steps:**
1. Deploy attacker contract implementing `isValidSignature(bytes32,bytes)` returning `0x1626ba7e`, `supportsInterface` returning true for `0x01ffc9a7` and `0x10704b42`, and `poolState(string)` returning `(0,0,0,0,0,QUEST,0,attacker)`.
2. Call `MURE_DISTRIBUTION.distribute(Distribution{token:QUEST, source:attacker, from:VICTIM, to:attacker, poolId:"quest", amount:4848683803036, deadline:block.timestamp+1}, attacker, "")`.
3. Approve Uniswap V3 router for QUEST and swap QUEST->USDC->WETH via `exactInput` with path `QUEST/10000/USDC/500/WETH`.
4. Unwrap WETH via `withdraw` and transfer ETH to attacker.
**Exploitation:** Attacker contract posed as both the `signer` and `source`; its ERC1271 stub approved any hash, so distribute() moved the victim's QUEST balance to the attacker. Drained QUEST was swapped on Uniswap V3 to WETH and unwrapped to ETH (~5.45 ETH profit).
**Insight:** When a contract accepts a caller-supplied `signer`/validator address for ERC1271 or similar pluggable verification, check whether the signer is pinned to an allowlist; if not, deploy a stub that always returns the magic value and forge any signed action.
