Research · Web3 Security · Medium
Leftover proxy balances can fund another caller’s swap
When Permit2 pulls more tokens than the router sells, the balance and allowance left in the proxy can let a later caller swap someone else’s tokens.
9 November 2026
What went wrong
Permit2Proxy pulled tokens from the caller through Permit2, then forwarded caller-supplied routerCalldata to the router. It did not bind the amount pulled to the sell amount encoded in that calldata.
If the proxy pulled more than the router spent, the difference remained in the proxy. A matching ERC20 allowance also remained available to the router. The proxy's balance snapshot included those leftovers at the start of the next call, so its return accounting did not refund them to the earlier caller.
Why it mattered
The report's proof of concept shows a user supplying 100 tokens while the router sells 80. The proxy retains 20 tokens and an allowance for them. A later caller supplies 1 token but asks the router to sell 21. The router can spend the combined balance, and the later caller receives the swap output for all 21 tokens.
The difference can arise when a caller's pull amount exceeds the amount in the router quote. The loss is the residual balance captured by the later caller, rather than a demonstrated ability to spend arbitrary tokens from the earlier caller's wallet.
The fix
The report recommends binding the pulled amount to the router's sell amount with an on-chain equality check, or refunding residual tokens and clearing the remaining proxy-to-router allowance after each call. It also recommends correcting the comment that claimed leftovers would be swept out automatically.
Takeaway
A proxy that holds tokens and allowances between calls carries state between users. Its accounting must bind downstream spending to the current call and return any unspent amount to the caller who supplied it.
Finding status: Fixed.
Shipping something similar? We review the code before it holds money.
Request an audit