LI.FI contest - ych18's results

Bridge & DEX Aggregation.

General Information

Platform: Code4rena

Start Date: 24/03/2022

Pot Size: $75,000 USDC

Total HM: 15

Participants: 59

Period: 7 days

Judge: gzeon

Id: 103

League: ETH

LI.FI

Findings Distribution

Researcher Performance

Rank: 28/59

Findings: 3

Award: $480.20

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: hickuphh3

Also found by: 0xDjango, WatchPug, catchup, csanuragjain, hyh, shw, ych18

Labels

bug
duplicate
2 (Med Risk)

Awards

303.3583 USDC - $303.36

External Links

Lines of code

https://github.com/code-423n4/2022-03-lifinance/blob/main/src/Facets/DexManagerFacet.sol#L73

Vulnerability details

  • DexManagerFacet.batchRemoveDex is used to remove many DEXs in the same transaction. However, the return in L73, will push the function to return directly after removing the first DEX in the _dexs list. So the actual implementation will just remove the first element in the list, which could be a serious problem as the contract owner could think that he removes an access to a DEXs while he doesn't. I put this as high because this affects the ACCESS CONTROL.

  • Recommendation: remove the return (as simple as that).

#0 - H3xept

2022-04-11T10:41:22Z

Duplicate of #34

#1 - gzeoneth

2022-04-16T16:34:19Z

Changing to Med Risk to align with #34

  • Incorrect revert msg in NXTPFacet.completeBridgeTokensViaNXTP. In fact, the native token could be in different blockchain (e.g Polygone and the native token is MATIC)

  • The transfer ownership system ( OwnershipFacet )does not follow for transfer-accept patterns. Which may lead to contract ownership accidentally being mismanaged. Recommendation: Implementing a transfer-accept pattern, or renouncing ownership of the contract may be preferred to countermeasure against mistaken ownership transfers.

  • it's better to replace the NATIVE_ASSET to another address rather than the address(0) to avoid any confusion that could happen (e.g WithdrawFacet.withdraw)

  • All contracts use an unlocked pragma ^0.8.7.

#0 - H3xept

2022-04-11T12:22:48Z

Re 2 step transfer ownership

Duplicate of #143

Awards

61.9811 USDC - $61.98

Labels

bug
G (Gas Optimization)
resolved
sponsor acknowledged

External Links

  • Function is declared as public but is only called externally. This occurs in a couple of instances:
  • NXTPFacet: startBridgeTokensViaNXTP, swapAndStartBridgeTokensViaNXTP, completeBridgeTokensViaNXTP and swapAndCompleteBridgeTokensViaNXTP
  • WithdrawFacet: withdraw
  • GenericSwapFacet: swapTokensGeneric
  • AnyswapFacet: swapAndStartBridgeTokensViaAnyswap, swapAndStartBridgeTokensViaAnyswap
  • The unchecked block can be used for all the for loops. Consider adding an internal function _increment with an unchecked block and use it to increment the counter inside the for loop.

  • LibAsset.decreaseERC20Allowance and LibAsset.increaseERC20Allowance are declared but never used

#0 - H3xept

2022-04-04T08:55:05Z

Re: Public -> External

Fixed in lifinance/lifi-contracts@26443af0142afdb131b6b3ab278fac29670b7b0e Duplicate of #197

#1 - H3xept

2022-04-04T08:55:21Z

Re: unchecked

We internally decided to avoid unchecked statements for now.

#2 - H3xept

2022-04-04T08:56:35Z

Re. increaseERC20Allowance && decreaseERC20Allowance

Used in FulfillInterpreter.sol

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter