ParaSpace contest - eierina's results

The First Ever Cross-Margin NFT Financialization Protocol.

General Information

Platform: Code4rena

Start Date: 28/11/2022

Pot Size: $192,500 USDC

Total HM: 33

Participants: 106

Period: 11 days

Judge: LSDan

Total Solo HM: 15

Id: 186

League: ETH

ParaSpace

Findings Distribution

Researcher Performance

Rank: 36/106

Findings: 2

Award: $622.39

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: csanuragjain

Also found by: Lambda, eierina, joestakey, unforgiven

Labels

bug
2 (Med Risk)
satisfactory
edited-by-warden
duplicate-235

Awards

355.653 USDC - $355.65

External Links

Lines of code

https://github.com/code-423n4/2022-11-paraspace/blob/c6820a279c64a299a783955749fdc977de8f0449/paraspace-core/contracts/protocol/tokenization/base/MintableIncentivizedERC721.sol#L290-L301 https://github.com/code-423n4/2022-11-paraspace/blob/c6820a279c64a299a783955749fdc977de8f0449/paraspace-core/contracts/protocol/tokenization/base/MintableIncentivizedERC721.sol#L320-L327

Vulnerability details

Impact

MintableIncentivizedERC721 incorrectly implements safeTransfer and safeTransferFrom by simply replicating the unsafe transfer/transferFrom function.

Raising as medium because as a consequence of this, these ERC721 tokens may end up locked in contracts that does not support ERC-721 tokens while at the same time offering the false impression of this event being impossible to whoever is using the safeTransfer/safeTransferFrom functions.

Proof of Concept

https://github.com/code-423n4/2022-11-paraspace/blob/c6820a279c64a299a783955749fdc977de8f0449/paraspace-core/contracts/protocol/tokenization/base/MintableIncentivizedERC721.sol#L290-L301 https://github.com/code-423n4/2022-11-paraspace/blob/c6820a279c64a299a783955749fdc977de8f0449/paraspace-core/contracts/protocol/tokenization/base/MintableIncentivizedERC721.sol#L320-L327

Tools Used

Either implement safe transfer for safeTransfer/safeTransferFrom function or revert on safeTransfer/safeTransferFrom if not willing to support safe tansfers.

#0 - c4-judge

2022-12-20T17:57:01Z

dmvt marked the issue as duplicate of #51

#1 - c4-judge

2023-01-23T16:16:17Z

dmvt marked the issue as satisfactory

Findings Information

🌟 Selected for report: Trust

Also found by: KingNFT, Lambda, csanuragjain, eierina, imare

Labels

bug
2 (Med Risk)
satisfactory
duplicate-497

Awards

266.7397 USDC - $266.74

External Links

Lines of code

https://github.com/code-423n4/2022-11-paraspace/blob/c6820a279c64a299a783955749fdc977de8f0449/paraspace-core/contracts/protocol/tokenization/base/MintableIncentivizedERC721.sol#L572-L582

Vulnerability details

Impact

The MintableIncentivizedERC721 base contract implements IERC165 interface, but the supportsInterface implementation does not comply to the EIP-165.

Raising as medium priority because the incorrect implementation defeats its own purpose.

Proof of Concept

The EIP-165 defines support for ERC-165 interface/implementation here and states the following:

How to Detect if a Contract Implements ERC-165

  1. The source contract makes a STATICCALL to the destination address with input data: 0x01ffc9a701ffc9a700000000000000000000000000000000000000000000000000000000 and gas 30,000. This corresponds to contract.supportsInterface(0x01ffc9a7).
  2. If the call fails or return false, the destination contract does not implement ERC-165.
  3. If the call returns true, a second call is made with input data 0x01ffc9a7ffffffff00000000000000000000000000000000000000000000000000000000.
  4. If the second call fails or returns true, the destination contract does not implement ERC-165.
  5. Otherwise it implements ERC-165.

How to Detect if a Contract Implements any Given Interface

  1. If you are not sure if the contract implements ERC-165, use the above procedure to confirm.
  2. If it does not implement ERC-165, then you will have to see what methods it uses the old-fashioned way.
  3. If it implements ERC-165 then just call supportsInterface(interfaceID) to determine if it implements an interface you can use.

Tools Used

Manual review.

Follow the EIP-165 or inherit from a correct ERC-165 implementation as OpenZeppelin's one and ensure the supportsInterface call follows the inheritance chain.

#0 - c4-judge

2022-12-20T17:59:18Z

dmvt marked the issue as duplicate of #52

#1 - c4-judge

2023-01-23T16:17:01Z

dmvt marked the issue as satisfactory

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