# _killWoundedAgents

LooksRare Infiltration's _killWoundedAgents ignores woundedAt, so a healed agent re-wounded later is killed by its stale prior-round wound, burning heal tokens.

- Payout: Contest reward
- Severity: high
- Program: Looksrare
- Credited: ast3ros
- Disclosed: 2023-10-18
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2023-10-looksrare-judging/issues/21
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-10-looksrare%3AH-1
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** Infiltration.sol game contract (fulfillRandomWords / _killWoundedAgents)
**Root cause:** _killWoundedAgents only checks agents[index].status == Wounded, not whether the wound originated in the round being processed, so a healed-then-rewounded agent matches the old round's wounded list.
**Steps:**
1. Start game and draw round 1, producing 20 wounded agents.
2. Heal the wounded agents in round 3 (all but one succeed).
3. Advance rounds; some healed agents get wounded again in a later round.
4. At round ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD+1, fulfillRandomWords calls _killWoundedAgents for the old round.
5. The re-wounded agent still has status Wounded and is killed despite being healed earlier; observe Killed event for that agent.
**How found:** Code reading of _killWoundedAgents: noticed the status check lacks a woundedAt comparison, then reasoned that fulfillRandomWords wounds new agents before killing old-round wounded, so a re-wounded healed agent matches the stale list.
**Exploitation:** No attacker action needed; the protocol itself kills a healed agent that was re-wounded, causing the user to lose LOOKS spent on healing and be forced out of the game.
**Insight:** When a contract tracks per-round lists of entities and later re-checks a mutable status flag, verify the flag is scoped to the round being processed; stale status matches cause wrongful state transitions.
