cBridge integration fails to send native tokens
The cBridge integration in the Li.Fi smart contract failed to send native tokens along with the external call, so bridging native tokens would revert. An attacker could not exploit this directly, but users would be unable to bridge native tokens through cBridge.
Submitted by hickuphh3, also found by hyh, rayn, shw, WatchPug, and wuwe1
The external sendNative() call fails to include sending the native tokens together with it.
Proof of Concept
Add the following test case to the CBridgeFacet test file.
// TODO: update bridge address to 0x5427FEFA711Eff984124bFBB1AB6fbf5E3DA1820
it.only('reverts because ETH not sent to bridge', async () => {
CBridgeData.token = constants.AddressZero
CBridgeData.amount = constants.One
await expect(lifi.connect(alice).startBridgeTokensViaCBridge(lifiData, CBridgeData, {
value: constants.One,
gasLimit: 500000
})).to.be.revertedWith('Amount mismatch');
})
Recommended Mitigation Steps
ICBridge(bridge).sendNative{ value: _cBridgeData.amount }(
_cBridgeData.receiver,
_cBridgeData.amount,
_cBridgeData.dstChainId,
_cBridgeData.nonce,
_cBridgeData.maxSlippage
);
In addition, add the payable keyword to the CBridge interface.
H3xept (Li.Fi) resolved and commented:
Fixed in lifinance/lifi-contracts@b684627b57c4891bee13fcfcfcf2595965843cc6
Valid POC. Sponsor confirmed with fix.
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
Impact
Users could not bridge native tokens via cBridge because the transaction would revert; no direct loss of funds is described.
What the attacker needed
User attempts to bridge native tokens via cBridge
The fix
The contract was fixed by attaching the native token amount to the sendNative call and marking the interface function as payable.
How it was found
- Set the bridge token to the zero address and amount to one.
- Call startBridgeTokensViaCBridge with a value of one and a gas limit.
- Observe the transaction reverts with 'Amount mismatch'.
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 bug in a smart contract that helps users move tokens between blockchains. When a user tried to send the blockchain's native currency (like ETH) through this bridge, the contract called the bridge but forgot to actually attach the money to the call, so the transaction failed. It's like writing a cheque but not signing it.
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.