AbraNFT contest - throttle's results

A peer to peer lending platform, using NFTs as collateral.

General Information

Platform: Code4rena

Start Date: 27/04/2022

Pot Size: $50,000 MIM

Total HM: 6

Participants: 59

Period: 5 days

Judge: 0xean

Id: 113

League: ETH

Abracadabra Money

Findings Distribution

Researcher Performance

Rank: 46/59

Findings: 1

Award: $72.39

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Awards

72.3862 MIM - $72.39

Labels

bug
disagree with severity
QA (Quality Assurance)

External Links

Lines of code

https://github.com/code-423n4/2022-04-abranft/blob/main/contracts/NFTPairWithOracle.sol#L295

Vulnerability details

Impact

NFT unrecoverable. Lender might not be able to handle NFT collateral if not implemented onERC721Received() function.

Proof of Concept

When Lender forcibly closes the Loan via removeCollateral() function, the loan.lender address gets the NFT collateral. If that address doesn't support NFTs then the asset is unrecoverable.

https://github.com/code-423n4/2022-04-abranft/blob/main/contracts/NFTPairWithOracle.sol#L295

Tools Used

Manual review

Possible mitigation:

  1. Consider using safeTransferFrom()
  2. Give Lender a choice where to send NFT, preferably in 2-step, push-pull style.

#0 - cryptolyndon

2022-05-05T21:34:56Z

I feel it's reasonable to expect that a party choosing to lend against NFT collateral can handle it. I see that part of the report as a duplicate of #20.

However, the "to" convenience parameter is no longer available when "liquidating" loans as a third party, and that restriction is not quite necessary; if the lender is also the caller, then "to" can be another address. So I'm marking that person (well, suggesting that it be marked) this as non-critical instead.

Suggested severity: 0

#1 - 0xean

2022-05-21T14:43:01Z

Downgrading to QA.

#2 - JeeberC4

2022-05-23T19:02:49Z

Preserving original title: NFT unrecoverable. Lender might not be able to handle NFT collateral if not implemented onERC721Received() function.

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