Reproduced Exploit
Uniswap The Compact — incorrect emissary storage slot breaks authorization
1. Emissary config slots must be keyed by (scope, sponsor, lockTag). 2. Buggy packing writes lockTag over the memory region holding sponsor. 3. All sponsors share one config per lockTag. 4. Attacker assignEmissary then claimAsEmissary steals any open lock for that tag. Fix: non-overlapping pack + h…
Chain
Other
Category
access-control
Date
May 2025
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 61280-incorrect-storage-slot-derivation-breaks-authorization-spear. Standalone Foundry PoC and full write-up: 61280-incorrect-storage-slot-derivation-breaks-authorization-spear_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/access-control/auth-bypass · vuln/loss-of-funds/direct-drain · vuln/storage/slot-collision
Reproduction: a self-contained Foundry PoC that compiles & runs in an isolated project with only
forge-std— no fork, no RPC, noanvil_state. Full trace: output.txt. PoC: test/61280-incorrect-storage-slot-derivation-breaks-authorization-spear_exp.sol.
AuditVault taxonomy: severity/high · sector/bridge · sector/dex · platform/spearbit · frozen-funds · direct-drain · bridge-sender-auth
Key info#
| Impact | CRITICAL/HIGH — emissary config slot ignores sponsor; attacker sets emissary for any user and claims their resource locks |
| Protocol | Uniswap The Compact — EmissaryLib._getEmissaryConfig |
| Vulnerable code | Assembly packs sponsor at 0x14 then mstore(0x20, lockTag) overwrites it before keccak256(0x1c, 0x24) |
| Bug class | Storage slot collision / broken authorization domain |
| Finding | Spearbit Uniswap The Compact May 2025 · #61280 · reporter Philogy |
| Report | Uniswap-The-Compact-Spearbit-Security-Review-May-2025 |
| Source | AuditVault |
| Status | Audit finding — fixed in commit 3caea0b7. Reproduced as a standalone local PoC. |
| Compiler | ^0.8.24 (PoC) |
TL;DR#
- Emissary config slots must be keyed by
(scope, sponsor, lockTag). - Buggy packing writes
lockTagover the memory region holdingsponsor. - All sponsors share one config per
lockTag. - Attacker
assignEmissarythenclaimAsEmissarysteals any open lock for that tag. Fix: non-overlapping pack + hash0x30bytes including sponsor.
The vulnerable code#
assembly ("memory-safe") {
mstore(0x14, sponsor)
mstore(0, scope)
mstore(0x20, lockTag) // overwrites sponsor
slot := keccak256(0x1c, 0x24) // @> VULN
}
// FIX: mstore(0x00, scope4); mstore(0x04, sponsor); mstore(0x24, lockTag);
// slot := keccak256(0x00, 0x30)
Root cause#
mstore(0x14, sponsor) places the 20-byte address so its bytes begin at 0x20. The subsequent mstore(0x20, lockTag) clobbers them. The hashed region therefore never contains the sponsor, so msg.sender is not part of the authorization domain.
Preconditions#
- Victim has locked balance under a
lockTag. - Attacker can call
assignEmissary(permissionless for own sponsor — but slot is shared).
Attack walkthrough#
- Victim deposits 100 LOCK under
lockTag. - Attacker
assignEmissary(lockTag, attacker)— writes the shared slot. getEmissary(victim, lockTag) == attacker.- Attacker
claimAsEmissary(victim, lockTag, attackerRecv, 100)drains the lock.
Diagrams#
Impact#
Any open resource lock for a given lockTag can be stolen once an attacker assigns the shared emissary. Affects all users; already-assigned emissaries only delay the attack until a reschedule window.
Sources#
- AuditVault finding #61280
- Spearbit Uniswap The Compact May 2025
- Reduced source:
EmissaryLib.sol#L65-L84— fixed in Uniswap Labs commit3caea0b7
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 61280-incorrect-storage-slot-derivation-breaks-authorization-spear_exp (evm-hack-registry mirror).
- AuditVault finding: 61280-incorrect-storage-slot-derivation-breaks-authorization-spear.
Alerts & third-party analyses
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.