Fund loss when insufficient call value to cover fee
The outboundTransfer function in L1LPTGateway does not verify that the call value covers the submission cost and gas fees, so if the value is too low the retryable ticket creation fails and funds are lost, or the ticket requires manual execution.
Submitted by gzeon.
Fund can be lost if the L1 call value provided is insufficient to cover _maxSubmissionCost, or stuck if insufficient to cover _maxSubmissionCost + (_maxGas * _gasPriceBid).
Proof of Concept
outboundTransfer in L1LPTGateway does not check if the call value is sufficient, if it is < _maxSubmissionCost the retryable ticket creation will fail and fund is lost; if it is <_maxSubmissionCost + (_maxGas * _gasPriceBid) the ticket would require manual execution.
function outboundTransfer(
address _l1Token,
address _to,
uint256 _amount,
uint256 _maxGas,
uint256 _gasPriceBid,
bytes calldata _data
) external payable override whenNotPaused returns (bytes memory) {
require(_l1Token == l1Lpt, "TOKEN_NOT_LPT");
// nested scope to avoid stack too deep errors
address from;
uint256 seqNum;
bytes memory extraData;
{
uint256 maxSubmissionCost;
(from, maxSubmissionCost, extraData) = parseOutboundData(_data);
require(extraData.length == 0, "CALL_HOOK_DATA_NOT_ALLOWED");
// transfer tokens to escrow
TokenLike(_l1Token).transferFrom(from, l1LPTEscrow, _amount);
bytes memory outboundCalldata = getOutboundCalldata(
_l1Token,
from,
_to,
_amount,
extraData
);
seqNum = sendTxToL2(
l2Counterpart,
from,
maxSubmissionCost,
_maxGas,
_gasPriceBid,
outboundCalldata
);
}
emit DepositInitiated(_l1Token, from, _to, seqNum, _amount);
return abi.encode(seqNum);
}
Recommended Mitigation Steps
Add check similar to the one used in L1GatewayRouter provided by Arbitrum team
uint256 expectedEth = _maxSubmissionCost + (_maxGas * _gasPriceBid);
require(_maxSubmissionCost > 0, "NO_SUBMISSION_COST");
require(msg.value == expectedEth, "WRONG_ETH_VALUE");
yondonfu (Livepeer) confirmed and disagreed with severity:
Labeled as disagree with severity because we think this is a 2 - Med finding. We think that the likelihood of this occurring is low because in almost all cases users should be interacting with this contract using an application that handles calculating the maxSubmissionCost properly which would prevent the reported issue. However, we do think that the impact if this occurs is high since LPT and ETH could be lost if the reported issue happens. Thus, we think 2 - Med is appropriate given that assets are not at direct risk, but there is a low probability path for assets to be lost.
0xleastwood (judge) commented:
I agree, there is potential for unintentional loss of funds, however, the attack vector makes assumptions on how this might occur. Due to the unlikely nature, I agree that this should be a
mediumseverity issue..
Fixed in https://github.com/livepeer/arbitrum-lpt-bridge/commit/6615bb8ce0fced895acd0e5d3e826c1e7b5d0138
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
Likely the outboundTransfer function lacks a check that the provided call value is sufficient to cover the submission cost and gas fees.
Impact
If the call value is insufficient, funds could be lost or stuck, though the likelihood is low because users typically interact through an application that calculates costs correctly.
What the attacker needed
User sends insufficient call value
The fix
The issue was fixed by adding a check similar to the one used in L1GatewayRouter.
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.
When you send a transaction on Ethereum, you pay a fee. This contract lets you move tokens to another network but doesn't check if you sent enough money to cover the fee. If you send too little, the fee payment fails and your tokens can be lost or 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.