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
Rank: 27/59
Findings: 3
Award: $632.50
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: hake
Also found by: Jujic, WatchPug, catchup, danb, defsec, kirk-baird, nedodn, shenwilly, sorrynotsorry
https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/WithdrawFacet.sol#L20-L38 https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/OwnershipFacet.sol#L8-L15
Risk of centralization
Diamond owner has too many roles on setting the functions, initiating payable functions. If the Owner account is compromised, the assets may be drained in this trustless system.
https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/WithdrawFacet.sol#L20-L38 https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/OwnershipFacet.sol#L8-L15
Static testing
Team can consider building the owner account in DAO or multisig.
#0 - H3xept
2022-04-12T10:10:15Z
Duplicate of #65
🌟 Selected for report: hyh
Also found by: Dravee, JMukesh, Jujic, peritoflores, shw, sorrynotsorry, wuwe1
https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Libraries/LibAsset.sol#L79-L85 https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/WithdrawFacet.sol#L20-L38
Withdrawals and transferERC20 tokens are executed via transferERC20()
and withdraw()
functions. Since these functions calls with a fixed amount of gas, it's not yet guaranteed to reach to the destination if the receiver is a smart contract.
https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Libraries/LibAsset.sol#L79-L85 https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/WithdrawFacet.sol#L20-L38
Outlines are here : https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/
Static testing
Team can consider using call.value(amount)
#0 - H3xept
2022-04-01T11:53:59Z
Fixed in lifinance/lifi-contracts@274a41b047b3863d9ae232eefea04896dc32d853
#1 - H3xept
2022-04-08T15:28:16Z
Duplicate of #14
🌟 Selected for report: hake
Also found by: 0v3rf10w, 0xDjango, 0xkatana, BouSalman, CertoraInc, Dravee, Hawkeye, IllIllI, JMukesh, Jujic, Kenshin, PPrieditis, Picodes, PranavG, Ruhum, SolidityScan, VAD37, WatchPug, aga7hokakological, catchup, csanuragjain, cthulhu_cult, defsec, dimitri, hickuphh3, hubble, hyh, kenta, kirk-baird, obront, peritoflores, rayn, robee, saian, samruna, shenwilly, shw, sorrynotsorry, tchkvsky, teryanarmen, ych18
132.5612 USDC - $132.56
constructor
function for the owner address in LiFiDiamond.sol
safeApprove
. LinkaddFunction()
in LibDiamond.sol
Team can consider adding statements as;
require(_selector != 0, "Error msg here"); require(_facetAddress != address(0), "Error msg here");
LibAsset.sol#L42-L45
WithdrawFacet.sol#L29
LibAsset.sol
inside transferNativeAsset()
enforceHasContractCode
in LibDiamond.sol
should not be relied on if the target is a contract inside the construction. Reference is hereif
statement in LibDiamond.sol#196
since the statement is assumed as not succeeded.LibDiamond.sol#79
can be considered to be thrown after initializeDiamondCut
function success.#0 - H3xept
2022-04-11T11:23:08Z
Duplicate of #82