# Rebalancer can steal funds from markets by sending to custom receiver through Everclear Bridge

Rebalancer EOA could set an unchecked EverclearBridge IntentParams.receiver to its own address, diverting market funds intended for rebalancing.

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

**Target:** EverclearBridge rebalancer bridge contract (sendMsg / newIntent)
**Root cause:** IntentParams.receiver passed to everclearFeeAdapter.newIntent is never validated against the destination market, so the trusted rebalancer can specify an attacker-controlled receiver.
**Steps:**
1. Rebalancer calls sendMsg with `_msg.message` ABI-encoded as IntentParams
2. Set `params.receiver` to an EOA/market controlled by the rebalancer instead of the destination Malda market
3. EverclearBridge decodes params and calls `everclearFeeAdapter.newIntent(destinations, receiver, inputAsset, outputAsset, amount, maxFee, ttl, data, feeParams)`
4. Bridged funds settle to the attacker-controlled receiver rather than the market
**How found:** Code review of EverclearBridge's IntentParams struct and newIntent call, noticing receiver is passed through with no check against the destination market.
**Exploitation:** A malicious or compromised rebalancer EOA crafts the bridge message with its own receiver address; the bridge forwards funds to that receiver, extracting market liquidity meant for rebalancing.
**Insight:** When a trusted role supplies a bridge/relay message, audit every field inside the encoded struct for validation against protocol-owned destinations—especially payout receiver addresses, which are the natural exfil point.

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

**IntentParams struct with unchecked receiver field**

```
struct IntentParams {
        uint32[] destinations;
        //@audit receiver is left unchecked
        bytes32 receiver;
        address inputAsset;
        bytes32 outputAsset;
        uint256 amount;
        uint24 maxFee;
        uint48 ttl;
        bytes data;
        IFeeAdapter.FeeParams feeParams;
    }
```

**newIntent call passing attacker-controlled receiver**

```
(bytes32 id,) = everclearFeeAdapter.newIntent(
    params.destinations,
    params.receiver,
    params.inputAsset,
    params.outputAsset,
    params.amount,
    params.maxFee,
    params.ttl,
    params.data,
    params.feeParams
);
```

