Several swap functions in the LiFi contracts record a token balance before and after executing external swap calls, then transfer the difference to the caller. Because the swap calls can re-enter the contract, an attacker could manipulate the post-swap balance calculation by calling functions like withdraw during the swap, potentially inflating the amount transferred.
The AnyswapFacet contract calls the underlying() function on a user-supplied token address multiple times, allowing an attacker to use a malicious token contract that returns different addresses on each call. This lets the attacker make the contract approve or transfer its own funds to an attacker-controlled router.
The withdraw function in WithdrawFacet uses payable.transfer() to send native tokens, which has a fixed gas limit of 2300 and can fail if the recipient is a contract with a costly fallback. This could cause native token withdrawals to fail, freezing funds if the contract owner is a smart contract.
Several ERC20 bridging functions in the Li.Fi contracts do not check that msg.value is zero, so any native funds sent with these calls remain stuck on the contract balance. An attacker could combine this with other issues to freeze or lose user funds.
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.
The swap function did not return excess input tokens when the actual amount used was less than the specified fromAmount, leaving funds stranded in the contract. An attacker could not directly steal others' funds, but users could lose their own excess tokens.
The swap function only transfers tokens from the user if the contract's own balance is less than the requested amount, so an attacker can swap using tokens already held by the contract. This allows the attacker to take any leftover ERC20 tokens that have accumulated in the contract.
The swapping functions in GenericSwapFacet and LibSwap do not verify that tokens were actually received after a swap. An attacker could supply calldata that calls a non-swapping function on a whitelisted router, causing the transaction to succeed without returning tokens, while the contract has already taken the user's input tokens.
The swap function used a user-supplied receiving asset identifier for the final transfer, which could differ from the asset actually received from the swap. If the two did not match, the swapped tokens remained stuck in the contract and the user lost them.
The contract's swap function repeatedly sends the same msg.value to external calls for each swap in a batch, allowing an attacker to drain the contract's native token balance by making multiple swaps from the native token. The attacker receives multiple times their original msg.value in swapped tokens.
The CBridgeFacet contract accepted more native tokens than the specified bridge amount, leaving the excess in the contract. An attacker could recover these stranded tokens, causing a loss of funds for the user who overpaid.
The contract owner has unrestricted power to change any contract functionality and withdraw all assets. This centralisation could damage the project's reputation even if the owner acts in good faith.
The batchRemoveDex function in DexManagerFacet only removes the first DEX from the approved list because it uses a return statement instead of break inside a loop. An attacker or user could believe multiple DEXes were removed when only one was, leaving others still approved for swaps.
A low-level call in the swap function can return success even when the target contract does not exist, so a failed swap does not revert. An attacker could use this to make a user's funds be transferred to the contract without receiving anything in return.
The contract granted infinite token approval to a router address supplied by the caller, which could be a fake contract. An attacker could use this to steal any tokens left in the contract.
LF
LI.FI contest
Medium
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.