# Callback payer not validated

Callback pulls funds from a caller-supplied payer address instead of msg.sender; check payer equals the real initiator

_Area: Smart contract access control and control flow. Seen in 2 disclosed reports; latest 2026-05-05. Updated 2026-11-17._

## How it works

A settlement or callback path needs to know whose funds to move. Instead of binding that to the address that actually initiated the operation (`msg.sender` at the entry point), the code reads a payer address from caller-supplied calldata or state. The assumption that breaks: that the payer field describes the caller. Anyone can put a victim's address there, so the contract debits the victim while the caller receives the proceeds. The callback itself often runs with `msg.sender` set to the pool/router, so the real initiator is no longer visible and must have been cached before the external call.

## Where it shows up

- Swap/settlement callbacks that decode a `payer`, `from`, or `src` field from calldata and deposit or transfer from it [E2](https://bugbountylibrary.com/r/sherlock%3A2023-06-dodo%3AH-3.md)
- Lock/forward/withdraw/pay router flows where the pay step funds a withdrawal from an address not tied to the caller [E1](https://bugbountylibrary.com/r/dhl%3A20260505-ekubo.md)
- `transferFrom` implementations that debit an allowance mapping keyed differently from the `from` argument, e.g. `_allowed[msg.sender][to]` instead of `_allowed[from][msg.sender]` [E3](https://bugbountylibrary.com/r/dhl%3A20250428-tcdp.md)
- Any external call where `msg.sender` becomes the pool/proxy, losing the original caller identity [E2](https://bugbountylibrary.com/r/sherlock%3A2023-06-dodo%3AH-3.md)
- Standing approvals to a proxy or router that a third party can trigger [E2](https://bugbountylibrary.com/r/sherlock%3A2023-06-dodo%3AH-3.md)

## How to review

Find every path that moves funds from an address that is not `msg.sender`. The invariant: the funded address must equal the address that authorized this specific operation — either `msg.sender` at entry, or a value cached before any external call and compared inside the callback. Trace the payer field from calldata to the debit; if nothing ties it to the initiator, it is exploitable. For token forks, diff `transferFrom` against the canonical ERC-20 and confirm the debited mapping is `_allowed[from][msg.sender]` [E3](https://bugbountylibrary.com/r/dhl%3A20250428-tcdp.md). For routers, confirm the pay callback's funding source is validated against the caller, not a fixed or attacker-chosen address [E1](https://bugbountylibrary.com/r/dhl%3A20260505-ekubo.md).

## How finders spotted it

- Read the sell flow and noticed the callback deposits from `decodeData.payer` with no check tying payer to the seller, since `msg.sender` is the pool inside the callback [E2](https://bugbountylibrary.com/r/sherlock%3A2023-06-dodo%3AH-3.md)
- Diffed the token's `transferFrom` against canonical ERC-20 and saw the wrong allowance mapping was debited, making self-approve plus `transferFrom(victim,...)` the fastest confirmation [E3](https://bugbountylibrary.com/r/dhl%3A20250428-tcdp.md)

## Variants seen

- Proxy swap callback with attacker-controlled payer in calldata, proceeds kept by attacker [E2](https://bugbountylibrary.com/r/sherlock%3A2023-06-dodo%3AH-3.md)
- Router lock/pay callback pulling from a fixed victim address across repeated iterations [E1](https://bugbountylibrary.com/r/dhl%3A20260505-ekubo.md)
- Token `transferFrom` debiting the wrong allowance key, enabling self-approve drain [E3](https://bugbountylibrary.com/r/dhl%3A20250428-tcdp.md)

## Impact and severity

Theft of user funds without any victim action beyond a standing approval or holding a balance. Severity is high to critical: E1 drained ~$1.4M via 85 repeated lock iterations [E1](https://bugbountylibrary.com/r/dhl%3A20260505-ekubo.md); E2 lets anyone sell any approved user's tokens and keep the output, repeatable across all users with approvals and front-runnable against new approvals [E2](https://bugbountylibrary.com/r/sherlock%3A2023-06-dodo%3AH-3.md); E3 drained all tokens from three holders and redeemed them for Compound ETH [E3](https://bugbountylibrary.com/r/dhl%3A20250428-tcdp.md). Impact scales with the number of addresses holding approvals or balances, and repetition multiplies a single flaw.

## Evidence
- E1: https://bugbountylibrary.com/r/dhl%3A20260505-ekubo.md
- E2: https://bugbountylibrary.com/r/sherlock%3A2023-06-dodo%3AH-3.md
- E3: https://bugbountylibrary.com/r/dhl%3A20250428-tcdp.md
