Platform: Code4rena
Start Date: 05/04/2022
Pot Size: $30,000 USDC
Total HM: 10
Participants: 47
Period: 3 days
Judge: gzeon
Total Solo HM: 4
Id: 106
League: ETH
Rank: 10/47
Findings: 4
Award: $518.64
π Selected for report: 0
π Solo Findings: 0
π Selected for report: cmichel
Also found by: AuditsAreUS, IllIllI, Ruhum, csanuragjain, danb, joshie, t11s, tintin
293.89 USDC - $293.89
https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L129
In case of collateral price fluctuation, lender can create a situation where borrower would be unable to repay the loan and lender could get hold of collateral
Always have a max lending amount. Also it would be great to have a feature where borrower can accept/reject lending offers
#0 - wilsoncusack
2022-04-05T16:28:46Z
Not an issue, is just how the protocol works. They are suggesting a feature change that we have a max amount
#1 - gzeoneth
2022-04-15T11:27:25Z
Duplicate of #24
139.9476 USDC - $139.95
https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L230
Since some tokens take transfer fees on performing transfer operations and current contract implementation is not considering same, lender funds could be lost
Obtain the actual amount which is transferred to/from the contract
#0 - wilsoncusack
2022-04-05T16:29:21Z
Won't fix. Perils of using one of these tokens. Lender should know risks. Borrower also affected as they will received less than loanAmount - origination_fee
#1 - wilsoncusack
2022-04-06T18:18:21Z
duplicate to fee on transfer tokens
#2 - wilsoncusack
2022-04-06T20:01:45Z
#33
#3 - gzeoneth
2022-04-15T13:18:30Z
π Selected for report: IllIllI
Also found by: 0v3rf10w, 0x1f8b, 0xDjango, 0xkatana, BouSalman, CertoraInc, Dravee, FSchmoede, Hawkeye, Kenshin, Meta0xNull, PPrieditis, Ruhum, TerrierLover, VAD37, WatchPug, berndartmueller, csanuragjain, hake, horsefacts, hubble, m9800, rayn, reassor, robee, samruna, securerodd, shenwilly, sorrynotsorry, t11s, teryanarmen, tintin, z3s
51.8678 USDC - $51.87
NFTLoanFacilitator.sol#L116 -> closeLoan function -> Attacker can create 10000+ loans with fake colleteral which will spam the system. Loan closing and opening from same wallet address should be allowed after certain duration of to prevent spamming. Even Admin cannot remove these fake loans from system, new function should be introduced to allow same
NFTLoanFacilitator.sol#L296 -> withdrawOriginationFees function -> Attacker creates loan using malicious loanAssetContractAddress token, Attacker himself lend the token which deducts the OriginationFees. Admin later tries withdrawing fees using withdrawOriginationFees which cause malicious code to execute
NFTLoanFacilitator.sol#L129 -> lend function -> Lender could set a very high duration (say 100 years) by mistake. His lended funds and interest will get stuck till 100 years are passed. Recommendation is to set a max duration for loan tenure
No functionality for loanAssetContractAddress migration. In case any security issue is found in loanAssetContractAddress and token is moved to new address, there is no way for admin to update the same in NFTLoanFacilitator contract. This will block borrower from closing the loan
#0 - wilsoncusack
2022-04-05T16:31:03Z
π Selected for report: Dravee
Also found by: 0v3rf10w, 0x1f8b, 0xkatana, CertoraInc, FSchmoede, Funen, IllIllI, Kenshin, Meta0xNull, TerrierLover, Tomio, csanuragjain, joshie, obront, rayn, rfa, robee, saian, securerodd, sorrynotsorry, t11s, z3s
32.9299 USDC - $32.93
LendTicket.sol#L27 -> _transfer function -> Add check from!=to
#0 - wilsoncusack
2022-04-05T16:28:15Z
won't do, don't want to change implementation and risk bugs