# Caller-supplied target or spender trusted

Caller-controlled target, spender, or calldata used without allowlist or selector check

_Area: Smart contract access control and control flow. Seen in 3 disclosed reports; latest 2024-05-23. Updated 2026-10-25._

## How it works
A privileged function accepts a target address, spender, or calldata blob from the caller and acts on it without constraining it to the intended protocol or function. The assumption that breaks: that the caller only passes legitimate values. When the contract itself (or a helper it trusts) is reachable through that same path, the caller can route the call back through a trusted entrypoint, so `msg.sender` or the whitelist check passes and downstream actions run with the contract's authority.

## Where it shows up
- Whitelist checks that validate only the target address, not the function selector [E1](https://bugbountylibrary.com/r/c4%3A2024-02-tapioca%3AH-06.md)
- The calling contract is itself on its own whitelist, enabling self-calls [E1](https://bugbountylibrary.com/r/c4%3A2024-02-tapioca%3AH-06.md)
- Fees or accounting enforced inside a helper reached by `delegatecall` from a user-controlled proxy [E2](https://bugbountylibrary.com/r/c4%3A2023-10-opendollar%3AM-07.md)
- `approve(type(uint256).max, spender)` where `spender` is caller-supplied [E3](https://bugbountylibrary.com/r/c4%3A2023-09-asymmetry%3AM-02.md)
- Arbitrary `swapTarget`/`swapCallData` executed with no protocol or output-token check [E3](https://bugbountylibrary.com/r/c4%3A2023-09-asymmetry%3AM-02.md)
- Docs promising a specific DEX while code accepts any target [E3](https://bugbountylibrary.com/r/c4%3A2023-09-asymmetry%3AM-02.md)

## How to review
For every function taking a target, spender, or calldata from the caller, ask: is this value constrained to an allowlist of addresses AND selectors, and is the calling contract excluded from that allowlist? The invariant: a caller-supplied call must not be able to reach a trusted entrypoint or move tokens beyond the documented protocol. Check that fees/accounting are enforced in the state-changing entrypoint itself, not only in a delegatecall helper [E2](https://bugbountylibrary.com/r/c4%3A2023-10-opendollar%3AM-07.md). Check that approvals are bounded and the spender is fixed or allowlisted [E3](https://bugbountylibrary.com/r/c4%3A2023-09-asymmetry%3AM-02.md).

## Variants seen
- Selector-blind whitelist plus self-whitelisting, enabling re-entry as any user [E1](https://bugbountylibrary.com/r/c4%3A2024-02-tapioca%3AH-06.md)
- User-supplied proxy target skips tax collected only in the delegatecall helper [E2](https://bugbountylibrary.com/r/c4%3A2023-10-opendollar%3AM-07.md)
- Unbounded approval and arbitrary call in a reward-swap function [E3](https://bugbountylibrary.com/r/c4%3A2023-09-asymmetry%3AM-02.md)

## Impact and severity
Led to theft of user-approved tokens [E1](https://bugbountylibrary.com/r/c4%3A2024-02-tapioca%3AH-06.md), fee bypass [E2](https://bugbountylibrary.com/r/c4%3A2023-10-opendollar%3AM-07.md), and loss of strategy-held value [E3](https://bugbountylibrary.com/r/c4%3A2023-09-asymmetry%3AM-02.md). Severity rises when the trusted path holds user approvals or the contract's own balance, and when the contract is reachable through its own allowlist.

## Evidence
- E1: https://bugbountylibrary.com/r/c4%3A2024-02-tapioca%3AH-06.md
- E2: https://bugbountylibrary.com/r/c4%3A2023-10-opendollar%3AM-07.md
- E3: https://bugbountylibrary.com/r/c4%3A2023-09-asymmetry%3AM-02.md
