# Rebalancer can send to unallowed destination chains through EverclearBridge

EverclearBridge validated only that one of many intent destinations matched the requested chain, letting a rebalancer route funds to unhandled chains and lose them.

- Payout: Audit contest
- Severity: medium
- Program: Malda
- Found by: cergyk
- Disclosed: 2025-07-22
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-07-malda-judging/issues/123
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-07-malda%3AM-5
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:access-control vuln:business-logic

**Target:** EverclearBridge rebalancer bridge contract (sendMsg / IntentParams)
**Root cause:** sendMsg only checks that _dstChainId appears somewhere in the IntentParams.destinations array, but the Everclear intent is created with all destinations and can be fulfilled on any of them, including chains Malda does not handle.
**Steps:**
1. Call rebalancer sendMsg with _dstChainId = allowed chain A
2. Encode IntentParams with destinations = [A, B] where B is an unhandled chain
3. Loop check finds A and passes require(found)
4. Everclear intent is created with both destinations
5. Solver fulfills intent on chain B; funds land on unhandled chain and are lost
**How found:** Code review of EverclearBridge.sendMsg: noticed destinations is an array while validation only checks membership of _dstChainId, then reasoned that the full array is forwarded to Everclear, allowing settlement on any listed chain.
**Exploitation:** A rebalancer (or compromised/erroneous rebalancer config) submits an intent listing an extra unhandled destination; the bridge's membership check passes because the requested chain is present, and the intent settles on the unhandled chain, stranding funds.
**Insight:** When a bridge/relayer takes an array of destinations but validates only membership of one, check whether the downstream protocol honors the whole array — array-vs-scalar validation mismatch lets extra entries slip through.

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

**EverclearBridge destination validation loop allowing multiple chains**

```
bool found;
    for (uint256 i; i < destinationsLength; ++i) {
        if (params.destinations[i] == _dstChainId) {
            found = true;
            break;
        }
    }
    require(found, Everclear_DestinationNotValid());
```

