# Third-party action reverts victim flow

Permissionless calls that shift live state so a victim's withdrawal, claim or liquidation reverts

_Area: Smart contract access control and control flow. Seen in 2 disclosed reports; latest 2023-08-09. Updated 2026-12-05._

## How it works
A victim's action depends on state that a permissionless function lets anyone change. The victim's transaction is built against state at submission time; between submission and execution, an attacker makes a cheap, reversible change. The victim's call then fails a check that is recomputed from live state, or fails because an asset it expects to hold is gone. The attacker pays little or nothing and can repeat it. The broken assumption is that state seen at submission still holds at execution, and that only the victim can move the state the victim's flow depends on.

## Where it shows up
- A caller-supplied amount compared against a bound recomputed from live balances at execution (liquidation `repayAmount` vs `maxClose` from current `borrowBalance`) [E1](https://bugbountylibrary.com/r/c4%3A2023-05-venus%3AM-08.md)
- Withdrawal paths that call `safeTransferFrom` and assume the contract still holds the token [E2](https://bugbountylibrary.com/r/c4%3A2023-05-particle%3AM-01.md)
- Permissionless functions that move a token out of the contract temporarily (open a loan, swap) and can be reversed cheaply [E2](https://bugbountylibrary.com/r/c4%3A2023-05-particle%3AM-01.md)
- Claim/mint functions callable by anyone for any beneficiary, with a caller-supplied array controlling how a balance is split [E3](https://bugbountylibrary.com/r/c4%3A2023-04-party%3AM-04.md)
- Any validation where a tiny deposit, repayment or donation shifts the recomputed value [E1](https://bugbountylibrary.com/r/c4%3A2023-05-venus%3AM-08.md)

## How to review
For each victim flow, list every piece of state it reads and ask who can change it. The invariant: no permissionless call by a third party may change state that a pending victim transaction depends on, unless the victim's call tolerates the change (slippage bounds, partial fills, retry). Check that caller-supplied amounts are compared against a bound the caller also controls or that is snapshotted, not recomputed from live state [E1](https://bugbountylibrary.com/r/c4%3A2023-05-venus%3AM-08.md). Check that withdrawal paths either hold the asset for the duration or handle its absence [E2](https://bugbountylibrary.com/r/c4%3A2023-05-particle%3AM-01.md). Check that claim/mint splitting is restricted to the beneficiary or bounded in array length and per-item size [E3](https://bugbountylibrary.com/r/c4%3A2023-04-party%3AM-04.md).

## How finders spotted it
- Read the validation hook and noticed `maxClose` came from live `borrowBalance` while `repayAmount` was fixed at submission, so any intervening debt change breaks the comparison [E1](https://bugbountylibrary.com/r/c4%3A2023-05-venus%3AM-08.md)
- Read the withdrawal's reliance on `safeTransferFrom` succeeding, then saw a permissionless swap removes the NFT and a repay refunds it at zero interest, making the grief free [E2](https://bugbountylibrary.com/r/c4%3A2023-05-particle%3AM-01.md)
- Read the `claimMultiple` loop, saw the `votingPowerByCard` array was caller-controlled and there was no `msg.sender == contributor` check, then reasoned about fragmenting a large deposit into minimum-size cards [E3](https://bugbountylibrary.com/r/c4%3A2023-04-party%3AM-04.md)

## Variants seen
- Liquidation griefing by a 1-wei repayment shrinking the close bound [E1](https://bugbountylibrary.com/r/c4%3A2023-05-venus%3AM-08.md)
- NFT withdrawal griefing by temporarily pulling the token out via a loan/swap [E2](https://bugbountylibrary.com/r/c4%3A2023-05-particle%3AM-01.md)
- Voting-power fragmentation and gas inflation via third-party claim [E3](https://bugbountylibrary.com/r/c4%3A2023-04-party%3AM-04.md)

## Impact and severity
Liquidations blocked, withdrawals blocked, and claims fragmented, each at near-zero attacker cost and repeatable [E1](https://bugbountylibrary.com/r/c4%3A2023-05-venus%3AM-08.md)[E2](https://bugbountylibrary.com/r/c4%3A2023-05-particle%3AM-01.md)[E3](https://bugbountylibrary.com/r/c4%3A2023-04-party%3AM-04.md). Severity rises with how cheap and reversible the grief is and how long the victim flow can be stalled.

## Evidence
- E1: https://bugbountylibrary.com/r/c4%3A2023-05-venus%3AM-08.md
- E2: https://bugbountylibrary.com/r/c4%3A2023-05-particle%3AM-01.md
- E3: https://bugbountylibrary.com/r/c4%3A2023-04-party%3AM-04.md
