AbraNFT contest - hubble'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: 45/59

Findings: 1

Award: $72.40

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-04-abranft/blob/5cd4edc3298c05748e952f8a8c93e42f930a78c2/contracts/NFTPair.sol#L205-L221

Vulnerability details

If by mistake, the 'to' address parameter in function requestLoan(), is set to zero address by the UI or thru direct function call, then the NFT will get stuck within the NFTPair contract, with no means of transferring it to any other owner.

After the requestLoan() call, the NFT will be transferred to the NFTPair contract address, and both lend() and removeCollateral() will fail, due to the loan.borrower set to zero address.

Impact

No means of rescuing the NFT token, its equivalent to loss of NFT.

Proof of Concept

Contract : NFTPair.sol Functions : requestLoan() line# 221 loan.borrower = to;

Add a simple null check for the 'to' address in the requestLoan() function. Additionally its good to add null check for 'recipient' address in function requestAndBorrow() also.

#0 - cryptolyndon

2022-05-05T22:38:36Z

Duplicate of #91.

#1 - 0xean

2022-05-21T14:17:59Z

downgrading to QA.

#2 - JeeberC4

2022-05-23T19:11:11Z

Preserving original title: NFT token will get stuck in the NFTPair contract, if requestLoan initiated with null 'to' address

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