# Callback and account assumptions break calls

Reentrancy guards or sender asserts on callbacks that legitimate flows must re-enter or delegatecall

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

## How it works
A contract assumes a function is only reached by an outside attacker, or that `msg.sender` is always the direct caller. Two assumptions break. First, a callback (`receive()`/fallback) that a legitimate external flow must re-enter gets a blanket `nonReentrant` guard, so the required callback reverts and the whole flow fails [E1](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AH-03.md). Second, a fallback asserts on `msg.sender` (e.g. `!= bootloader`); under `delegatecall` from a custom account, `msg.sender` becomes the caller's caller, so the assert fires even though the contract promises EOA-equivalent behavior [E2](https://bugbountylibrary.com/r/c4%3A2023-10-zksync%3AM-18.md). In both cases the guard/assert is fatal to a valid path, not protective.

## Where it shows up
- A function that both makes an external call and receives a callback in the same flow, with `nonReentrant` on both the initiator and the callback [E1](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AH-03.md).
- `receive()`/fallback carrying `nonReentrant` where an external protocol pays out ETH by calling back [E1](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AH-03.md).
- Fallback/receive with `assert`/`require` on `msg.sender` in a contract documented as EOA-equivalent [E2](https://bugbountylibrary.com/r/c4%3A2023-10-zksync%3AM-18.md).
- Redeposit paths calling an external vault/strategy that can revert on zero shares or deposit caps [E3](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AM-01.md).

## How to review
For each guarded or asserted function, ask: does a legitimate flow need to re-enter or delegatecall here? The invariant: a guard must block only attacker paths, never a callback the protocol itself triggers. Check that `nonReentrant` is not on both sides of one required callback [E1](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AH-03.md). For EOA-equivalent contracts, trace `msg.sender` under `delegatecall` and confirm sender asserts still hold [E2](https://bugbountylibrary.com/r/c4%3A2023-10-zksync%3AM-18.md). For redeposit paths, confirm the external call cannot revert the whole withdrawal (zero-share mint, deposit limits) [E3](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AM-01.md).

## How finders spotted it
- Read the modifiers on both `completeQueuedWithdrawal` and `receive()`, then reasoned that `receiveAsTokens=true` legitimately re-enters `receive()` via EigenPod, making the guard fatal [E1](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AH-03.md).
- Read docs claiming EOA-equivalent behavior, compared fallback/receive implementation, and reasoned about the delegatecall path where `msg.sender` becomes the bootloader [E2](https://bugbountylibrary.com/r/c4%3A2023-10-zksync%3AM-18.md).
- Read the redeposit path and cross-referenced the external StrategyManager's `shares>0` check and deposit caps to find revert conditions [E3](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AM-01.md).

## Variants seen
- Blanket `nonReentrant` on a callback the protocol must re-enter [E1](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AH-03.md).
- Sender assert in fallback breaking under delegatecall from a custom account [E2](https://bugbountylibrary.com/r/c4%3A2023-10-zksync%3AM-18.md).
- External redeposit reverting on zero shares or deposit limits, bricking withdrawal [E3](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AM-01.md).

## Impact and severity
ETH withdrawals always revert and funds stay stuck [E1](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AH-03.md); custom accounts cannot behave like EOAs [E2](https://bugbountylibrary.com/r/c4%3A2023-10-zksync%3AM-18.md); withdrawals and deposits can be blocked by external revert conditions [E3](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AM-01.md). Severity is high when funds are locked [E1](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AH-03.md), medium when behavior diverges or paths can be blocked [E2](https://bugbountylibrary.com/r/c4%3A2023-10-zksync%3AM-18.md)[E3](https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AM-01.md).

## Evidence
- E1: https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AH-03.md
- E2: https://bugbountylibrary.com/r/c4%3A2023-10-zksync%3AM-18.md
- E3: https://bugbountylibrary.com/r/c4%3A2024-04-renzo%3AM-01.md
