# Permanent loss of user tokens on both chains if BurnUnlock mode fails because of flawed burning pattern

Chakra bridge burns tokens on source chain in BurnUnlock mode before destination unlock succeeds, permanently losing user funds on both chains when bridging fails.

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

**Target:** ChakraSettlementHandler cross-chain ERC20 settlement contract
**Root cause:** BurnUnlock mode calls _erc20_burn on the source chain immediately in cross_chain_erc20_settlement, with no callback to restore tokens if the destination-chain unlock fails; unlike MintBurn which locks first and burns only on success callback.
**Steps:**
1. Alice calls `cross_chain_erc20_settlement` with mode `BurnUnlock` and amount 1000 CHKR.
2. Source chain executes `_erc20_burn(msg.sender, amount)` immediately, zeroing Alice's balance.
3. Destination chain `receive_cross_chain_msg` attempts `_erc20_unlock(to, amount)` but fails (insufficient validator signatures, or Alice has <1000 CHKR locked on destination).
4. No BurnUnlock branch exists in `receive_cross_chain_callback`, so nothing unlocks or refunds on source.
5. Alice now has 0 CHKR on source and 1000 CHKR still locked on destination; retrying requires equivalent tokens she no longer holds, so funds are permanently stuck.
**How found:** Compared the burn/lock ordering of MintBurn (lock source -> mint dest -> burn on success callback) against BurnUnlock (burn source -> unlock dest) and noticed BurnUnlock lacks the callback safety net, so any destination failure strands tokens.
**Exploitation:** Not an active attack; failure of the cross-chain message (e.g. malicious validator withholding signatures to block threshold, or insufficient locked balance on destination) causes irreversible burn on source with no refund path.
**Insight:** When auditing cross-chain bridges, diff the state-mutation ordering across settlement modes: a mode that mutates source state before destination confirmation without a failure callback is a fund-loss vector even if the happy path works.

