Unenforced maxFee and ttl Parameters in sendMsg Function
The EverclearBridge contract's sendMsg function does not enforce that maxFee and ttl are zero, as required for the netting pathway. An attacker could set non-zero values, causing intents to be misrouted to the unsupported solver pathway, leading to settlement failures or unexpected fees.
Source: https://github.com/sherlock-audit/2025-07-malda-judging/issues/317
Found by
0xsai, yoooo
Summary
In the EverclearBridge which is used by rebalancer to send cross-chain intents using Everclear does not enforce that the maxFee and ttl parameters are set to 0, as required for the netting pathway. The Everclear documentation specifies that rebalancers must use the netting pathway, where maxFee == 0 (no solver fees) and ttl == 0 (immediate processing by the hub). However, the contract passes these parameters to everclearFeeAdapter.newIntent without validation, allowing non-zero values that could misroute intents to the unsupported solver pathway.
Root Cause
The sendMsg function in EverclearBridge.sol lacks validation checks to ensure params.maxFee == 0 and params.ttl == 0 before calling everclearFeeAdapter.newIntent as specified in the everclear docs..
function sendMsg(
uint256 _extractedAmount,
address _market,
uint32 _dstChainId,
address _token,
bytes memory _message,
bytes memory // unused
) external payable onlyRebalancer {
IntentParams memory params = _decodeIntent(_message);
require(params.inputAsset == _token, Everclear_TokenMismatch());
require(_extractedAmount >= params.amount, BaseBridge_AmountMismatch());
uint256 destinationsLength = params.destinations.length;
require(destinationsLength > 0, Everclear_DestinationsLengthMismatch());
bool found;
for (uint256 i; i < destinationsLength; ++i) {
if (params.destinations[i] == _dstChainId) {
found = true;
break;
}
}
require(found, Everclear_DestinationNotValid());
if (_extractedAmount > params.amount) {
uint256 toReturn = _extractedAmount - params.amount;
IERC20(_token).safeTransfer(_market, toReturn);
emit RebalancingReturnedToMarket(_market, toReturn, _extractedAmount);
}
SafeApprove.safeApprove(params.inputAsset, address(everclearFeeAdapter), params.amount);
(bytes32 id,) = everclearFeeAdapter.newIntent(
params.destinations,
params.receiver,
params.inputAsset,
params.outputAsset,
params.amount,
params.maxFee,
params.ttl,
params.data,
params.feeParams
);
emit MsgSent(_dstChainId, _market, params.amount, id);
}
Internal Pre-conditions
- Already does not validates
maxFeeandttl
External Pre-conditions
- both
maxFeeandttl being none zero
Attack Path
- A rebalancer calls the
sendMsgto create a cross-chain intent with both themaxFeeandttlbeing none zero - The _decodeIntent function decodes the message into IntentParams, extracting maxFee (type uint24) and ttl (type uint48).
- The FeeAdapter may interpret non-zero maxFee or ttl as a solver pathway intent, misrouting the intent to solvers instead of the netting system.
- Since the solver pathway is not supported at launch, the intent may fail to settle, or, if solvers are active, it may incur unexpected fees or settle on a suboptimal chain.
Impact
- A potential DOS
- Non-zero maxFee or ttl could route intents to the solver pathway, which is unsupported, leading to settlement failures or delays that disrupt liquidity rebalancing across supported chains (e.g., Ethereum, Base, Linea, Optimism, Unichain, Arbitrum).
- may lead to loss of funds.
- when maxFee is not enforced as 0 the everclear netting pathway will not be used and protocol will not be able to cut their cost up to 10x
PoC
.
Mitigation
enforce both fields are validated..
function sendMsg(
uint256 _extractedAmount,
address _market,
uint32 _dstChainId,
address _token,
bytes memory _message,
bytes memory // unused
) external payable onlyRebalancer {
IntentParams memory params = _decodeIntent(_message);
require(params.inputAsset == _token, Everclear_TokenMismatch());
require(_extractedAmount >= params.amount, BaseBridge_AmountMismatch());
// Enforce netting pathway requirements
require(params.maxFee == 0, Everclear_InvalidMaxFee());
require(params.ttl == 0, Everclear_InvalidTtl());
uint256 destinationsLength = params.destinations.length;
require(destinationsLength > 0, Everclear_DestinationsLengthMismatch());
bool found;
for (uint256 i; i < destinationsLength; ++i) {
if (params.destinations[i] == _dstChainId) {
found = true;
break;
}
}
require(found, Everclear_DestinationNotValid());
if (_extractedAmount > params.amount) {
uint256 toReturn = _extractedAmount - params.amount;
IERC20(_token).safeTransfer(_market, toReturn);
emit RebalancingReturnedToMarket(_market, toReturn, _extractedAmount);
}
SafeApprove.safeApprove(params.inputAsset, address(everclearFeeAdapter), params.amount);
(bytes32 id,) = everclearFeeAdapter.newIntent(
params.destinations,
params.receiver,
params.inputAsset,
params.outputAsset,
params.amount,
params.maxFee, // Now guaranteed to be 0
params.ttl, // Now guaranteed to be 0
params.data,
params.feeParams
);
emit MsgSent(_dstChainId, _market, params.amount, id);
}
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/malda-protocol/malda-lending/pull/143
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 sendMsg function lacks validation to ensure params.maxFee and params.ttl are zero before calling everclearFeeAdapter.newIntent.
Impact
Non-zero maxFee or ttl could route intents to the unsupported solver pathway, leading to settlement failures or delays that disrupt liquidity rebalancing, and may lead to loss of funds.
What the attacker needed
Rebalancer role; non-zero maxFee and ttl
The fix
The protocol team fixed this issue by adding validation to enforce that maxFee and ttl are zero.
How it was found
- A rebalancer calls sendMsg with non-zero maxFee and ttl.
- The _decodeIntent function extracts maxFee and ttl from the message.
- The FeeAdapter may interpret non-zero values as a solver pathway intent.
- The intent may fail to settle or incur unexpected fees.
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.
This is a smart contract bug where a function that sends cross-chain messages fails to check that two settings are zero. If they are not zero, the message might go through the wrong system, which could cause delays or extra costs.
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.