Skip to content

Code4rena

LI.FI contest

Every publicly disclosed report for LI.FI contest and what kind of bugs they were.

disclosed reports
15
most reported class
Business logic
bug classes found
4
first disclosure
2022
Find LI.FI contest on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what LI.FI contest chose to make public.

Audit finding

Swap functions are Reenterable

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.

LI.FI contest

Medium
Smart contracts

AnyswapFacet can be exploited to approve arbitrary tokens.

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.

LI.FI contest

Medium
Business logic

ERC20 bridging functions do not revert on non-zero msg.value

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.

LI.FI contest

Medium
Business logic

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.

LI.FI contest

Medium
Business logic

LibSwap: Excess funds from swaps are not returned

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.

LI.FI contest

Medium
Business logic

Anyone can get swaps for free given certain conditions in swap .

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.

LI.FI contest

Medium
Business logic

All swapping functions lack checks for returned tokens

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.

LI.FI contest

High
Business logic

Reliance on lifiData.receivingAssetId can cause loss of funds

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.

LI.FI contest

High
Business logic

msg.value is Sent Multipletimes When Performing a Swap

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.

LI.FI contest

Medium
Access control

Reputation Risks with contractOwner

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.

LI.FI contest

Medium
Business logic

DexManagerFacet: batchRemoveDex() removes first dex only

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.

LI.FI contest

Medium
Business logic

Failed transfer with low level call won’t revert

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.

LI.FI contest

Medium