Skip to content
Business logic Audit finding Intermediate

Rebalancer can send to unallowed destination chains through EverclearBridge

The rebalancer's EverclearBridge only checked that one of the supplied destination chains matched the requested chain, but passed the whole list to Everclear. An attacker could have the intent fulfilled on a chain Malda does not handle, causing the funds to be lost.

cergyk Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-07-malda-judging/issues/123

Found by

cergyk

Description

The rebalancer contract is called on sendMsg with a message encoded as bytes (_msg.message). This message is specific for the bridge contract, and in the case of EverclearBridge it is of the form IntentParams:

EverclearBridge.sol#L40-L50:

Solidity
    struct IntentParams {
        uint32[] destinations;
        bytes32 receiver;
        address inputAsset;
        bytes32 outputAsset;
        uint256 amount;
        uint24 maxFee;
        uint48 ttl;
        bytes data;
        IFeeAdapter.FeeParams feeParams;
    }

We notice that multiple destination chains can be provided (destinations); Out of these chains, it is only checked that one is the _dstChainId provided as argument of sendMsg:

EverclearBridge.sol#L95-L102:

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

However, the intent is created on Everclear using all the provided destinations, and can be fulfilled on any of the chains of the list. If it is fulfilled on a chain that Malda does not handle, the funds are lost.

Recommendation

destinations should be checked to be of length 1, and that destinations[0] == _dstChainId

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/malda-protocol/malda-lending/pull/119/files

CergyK

Fix looks good, only 1 destination chain allowed now

The original report as published on Sherlock, by cergyk. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The bridge validated only that the requested destination appeared somewhere in the destinations array instead of requiring exactly one destination equal to it.

Impact

Funds could be delivered to an unhandled chain and lost; the text does not describe a live exploit, only the flawed check.

What the attacker needed

Rebalancer calls sendMsg with a multi-chain list

The fix

The destinations list should be restricted to a single entry equal to the requested chain; the text says this was fixed.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A bridge moves funds between blockchains. Here the code was meant to send funds to one specific chain, but it accepted a list of chains and only checked that the wanted one was somewhere in the list. The bridge could then deliver the money to a different chain in that list, where the project cannot manage it, so the money would be stuck.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by cergyk

View all

29 more disclosed reports, best first.

More from Malda

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.