# There is no refund mechanism in ChakraSettlement.processCrossChainCallback or ChakraSettlementHandler.receive_cross_chain_callback function

Chakra cross-chain ERC20 settlement has no refund path: if a message fails on the destination chain, the sender's locked or burned tokens are permanently lost.

- Payout: Audit contest
- Severity: high
- Program: Chakra
- Found by: rbserver
- Disclosed: 2025-02-20
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-08-chakra-findings/issues/115
- Library page: https://bugbountylibrary.com/r/c4%3A2024-08-chakra%3AH-11
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** ChakraSettlement / ChakraSettlementHandler cross-chain ERC20 settlement contracts
**Root cause:** receive_cross_chain_callback only marks the tx status Failed on failure; it never returns the tokens the caller locked in the source handler (MintBurn/LockUnlock/LockMint) or burned (BurnUnlock).
**Steps:**
1. Caller invokes `cross_chain_erc20_settlement(to_chain,to_handler,to_token,to,amount)`; tokens are locked in the source handler or burned.
2. Before the message is delivered, destination-chain owner calls `remove_handler(chain_name, handler)`, de-whitelisting the source handler.
3. Destination `receive_cross_chain_msg` sees `is_valid_handler(from_chain,from_handler)==false` and returns false; `ChakraSettlement.receive_cross_chain_msg` sets `receive_cross_txs[txid].status=Failed`.
4. Callback `processCrossChainCallback` -> `receive_cross_chain_callback` sets `create_cross_txs[txid].status=Failed` but performs no token transfer back to the caller.
5. Caller's locked/burned tokens remain stuck in the handler with no recovery path.
**How found:** Code review of the settlement lifecycle: traced the failure path from destination-side handler validation through the callback to the source chain and noticed the Failed branch only updates status without any token movement, unlike the Success branch which burns.
**Exploitation:** Not an attacker-driven exploit; a design flaw. A whitelist removal (or any other cross-chain failure) after initiation strands the sender's funds with no refund, causing permanent loss to the user.
**Insight:** When auditing cross-chain/bridge settlement flows, trace every terminal state of a message (success, failure, timeout) and verify each one moves value back to the initiator; a status-only Failed branch is a classic stuck-funds bug.

