Uniswap v4 hooks can lose tens of millions due to common app-level bugs
Most of the $20M+ losses in Uniswap v4 stem from recurring application-level hook vulnerabilities rather than flaws in the core protocol.
Security & privacy Trail of Bits 30 Jul 2026 Disclosure Theory
Published as “Building secure Uniswap v4 hooks”
Why it matters
Developers and auditors must apply the checklist to prevent costly hook-related exploits in Uniswap v4.
Summary
The post surveys dozens of audit findings and two high-profile exploits (Cork and Bunni) that together cost over $20 million. It identifies seven recurring failure patterns in Uniswap v4 hook implementations, such as missing caller checks, unrestricted pool creation, and custom accounting bugs that pass settlement checks. For each pattern it cites real-world incidents and recommends concrete mitigations like using BaseHook, SafeCallback, and strict allow-lists. The evidence is based on real audit reports and public post-mortems, but no new tooling or live testing is presented.
What they found 3
- Missing caller checks let attackers invoke hook callbacks directly.
“Anyone can call your hook Hook callbacks are external functions on your contract. If you don’t check the caller, an attacker can call those callbacks directly with malicious parameters.”
- Permissionless pool creation enables attackers to route logic through malicious pools.
“Pool creation through the PoolManager is permissionless by default. Unless your hook restricts initialization in beforeInitialize, anyone can create a pool with your hook address attached.”
- Custom accounting bugs can leak value while still satisfying the PoolManager’s settlement invariant.
“These bugs are subtle because settlement only checks that the session’s currency deltas resolve; it does not validate the hook’s internal accounting.”
What’s new here 4
- Enumeration of seven recurring hook failure patterns with concrete examples.
- A developer-oriented checklist and auditor questionnaire derived from real exploits.
- Guidance to use BaseHook and SafeCallback for automatic caller validation.
- Recommendations to fuzz nested callbacks and token edge-cases with Echidna and Medusa.