# Rebalancer can drain market funds via excessive bridge fees

Semi-trusted REBALANCER_EOA sets unchecked maxFee in EverclearBridge message, draining market liquidity to bridge fees.

- Payout: Audit contest
- Severity: medium
- Program: Malda
- Found by: befree3x
- Disclosed: 2025-07-22
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-07-malda-judging/issues/686
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-07-malda%3AM-12
- 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:** Rebalancer/EverclearBridge bridge transfer
**Root cause:** Rebalancer.sendMsg passes an unchecked _message blob; EverclearBridge decodes maxFee and forwards it to everclearFeeAdapter.newIntent without validating against any protocol-defined cap.
**Steps:**
1. Call `Rebalancer.sendMsg` targeting `EverclearBridge` and market `mWethHost` with `_amount`=10 WETH
2. Craft `_message` with bridge amount 10 WETH but `maxFee`=9.9 WETH
3. Rebalancer pulls 10 WETH from market and calls `EverclearBridge.sendMsg`
4. EverclearBridge decodes message, no maxFee validation, calls `everclearFeeAdapter.newIntent` with 9.9 WETH fee
5. Bridge takes up to 9.9 WETH as fee; ~0.1 WETH reaches destination
6. Repeat to drain market liquidity
**How found:** Trust-assumption review: rebalancer is deemed semi-trusted and 'cannot transfer user funds', so author traced the message blob through Rebalancer.sendMsg into EverclearBridge and found maxFee forwarded unvalidated to the external fee adapter.
**Exploitation:** Compromised/malicious REBALANCER_EOA repeatedly initiates bridge transfers with near-total maxFee, extracting market liquidity as fees paid to third-party relayers rather than to attacker directly.
**Insight:** When a role is documented as unable to move funds, audit every parameter it controls that reaches an external contract with fee/amount semantics; unchecked fee caps are a value-extraction vector even without direct payout.

