# In Starknet, already processed messages can be re-submitted and by anyone

Chakra's Starknet settlement handler lacks a tx-status check, letting anyone replay a processed cross-chain message to mint chakraBTC repeatedly.

- Payout: Audit contest
- Severity: high
- Program: Chakra
- Found by: Moksha
- Disclosed: 2025-02-20
- Write-up quality: 7/10
- Original: https://github.com/code-423n4/2024-08-chakra-findings/issues/334
- Library page: https://bugbountylibrary.com/r/c4%3A2024-08-chakra%3AH-02
- Tags: area:web3 domain:web3 impact:funds-loss impact:integrity kind:contest platform:code4rena sev:high tech:solidity technique:regression technique:source-review vuln:access-control vuln:signature-replay

**Target:** Starknet settlement_handler.cairo receive_cross_chain_msg
**Root cause:** receive_cross_chain_msg never verifies the stored tx_status is UNKNOW before processing, so an already-processed message with valid signatures can be re-executed.
**Steps:**
1. Obtain a previously processed receive_cross_chain_msg call (txId, signatures, payload) from a block explorer.
2. Fork Starknet Sepolia at latest block via snforge fork config.
3. Call `settlement_dispatcher.receive_cross_chain_msg(cross_chain_msg_id, from_chain, to_chain, from_handler, to_handler, sign_type, signatures, payload, payload_type)` with the same params.
4. Observe chakraBTC balance of payload recipient increase by 130000 per call (260000 -> 390000 -> 520000).
**How found:** Auditor read settlement.cairo against the documented invariant that a message can only be received once, noticed receive_cross_chain_msg lacked the CrossChainMsgStatus.UNKNOW check, then confirmed on a Sepolia fork by replaying a real processed message.
**Exploitation:** Attacker replays a valid, already-processed cross-chain message (with its operator signatures) to receive_cross_chain_msg; each replay re-mints/transfers chakraBTC to the payload recipient, draining protocol-backed value. No validator role needed since the function is callable by anyone.
**Escalation:** Repeat the same call arbitrarily many times to mint unbounded chakraBTC.
**Insight:** For cross-chain receivers, verify the message-id status is still UNKNOW (not just signature validity) before processing; replay of a legitimately signed message is the classic bridge drain. Fork-test against real deployed state to prove it.

