# Users will lock raffle prizes on the `WinnablesPrizeManager` contract by calling `WinnablesTicketManager::propagateRaffleWinner` with wrong CCIP inputs

Anyone can call propagateRaffleWinner with wrong CCIP params, permanently locking raffle prizes in PrizeManager.

- Payout: Audit contest
- Severity: high
- Program: Winnables Raffles
- Found by: 0rpse
- Disclosed: 2024-08-14
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-08-winnables-raffles-judging/issues/50
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-winnables-raffles%3AH-1
- Tags: area:web3 domain:web3 impact:dos impact:funds-loss kind:contest platform:sherlock sev:high technique:source-review vuln:access-control vuln:business-logic

**Target:** WinnablesTicketManager::propagateRaffleWinner
**Root cause:** propagateRaffleWinner accepts arbitrary prizeManager and chainSelector without validation and marks raffle as propagated, preventing retry.
**Steps:**
1. Win a raffle so propagateRaffleWinner can be called.
2. Call `propagateRaffleWinner(wrongPrizeManager, wrongChainSelector, raffleId)` with incorrect CCIP params.
3. Function succeeds, sets raffle state to propagated, and sends CCIP message to wrong destination.
4. PrizeManager never receives unlock message; assets remain locked.
**How found:** Code review identified missing validation on external function parameters and state change that blocks retry.
**Exploitation:** Any user calls propagateRaffleWinner with invalid prizeManager/chainSelector after a raffle is won; the CCIP message fails to reach the correct PrizeManager, and the raffle state prevents re-invocation, permanently locking the prize.
**Insight:** External functions that trigger cross-chain messages must validate destination contract and chain selector; otherwise anyone can grief by sending to wrong destination and marking state as done.

## Proof of concept (copied exactly from the original report)

**Test calling propagateRaffleWinner with random chainSelector**

```
it('Should be able to propagate when the winner is drawn', async () => {
@>    const { events } = await (await manager.propagateRaffleWinner(counterpartContractAddress, 9846, 1)).wait();
      expect(events).to.have.lengthOf(3);
      const ccipEvent = ccipRouter.interface.parseLog(events[0]);
      expect(ccipEvent.args.receiver).to.eq('0x' + counterpartContractAddress.toLowerCase().slice(-40).padStart(64, '0'));
      expect(ccipEvent.args.data).to.have.lengthOf(108);
      const drawnWinner = ethers.utils.getAddress('0x' + ccipEvent.args.data.slice(-40));
      expect(buyers.find(b => b.address === drawnWinner)).to.not.be.undefined;
      expect(ccipEvent.args.data.slice(0, 68)).to.eq('0x010000000000000000000000000000000000000000000000000000000000000001');
```

