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.
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:
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:
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
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.