reNFT Mitigation Review

Collateral-free, permissionless, and highly customizable EVM NFT rentals.

  • Start date27 Feb 2024
  • End date4 Mar 2024
  • Total awards$19,800 in USDC
  • Duration6 days

reNFT - Mitigation Review details

Important note

Each warden must submit a mitigation review for every High and Medium finding from the parent audit that is listed as in-scope for the mitigation review. Incomplete mitigation reviews will not be eligible for awards.

Findings being mitigated

Mitigations of all High and Medium issues will be considered in-scope and listed here.

Overview of changes

Token Whitelist

A token whitelist has been implemented to filter the tokens that are supported by the protocol. There are two whitelists: asset whitelist and payment whitelist.

For the asset whitelist, please assume that only "standard" ERC721/ERC1155 tokens will be added to this whitelist. The only exceptions to this are the burnable token extension and tokens that support permit() (EIP-4494). Any vulnerabilities found that involves that functionality will be considered in scope.

For the payment whitelist, please assume that only "standard" ERC20 tokens will be added to this whitelist. More specifically, we will plan to support: DAI, USDC, USDT. Other payment tokens will be considered out of scope.

In terms of what "standard" means, think of the Open Zeppelin implementations of these tokens. We will not be whitelisting any tokens that deviate too far from how we expect an ERC721/ERC1155/ERC20 token to behave.

Custom Fallback Handler

A custom fallback handler has been implemented on all rental safes upon deployment. This fallback handler should never be allowed to be removed by an owner of a rental safe. Additionally, it should be able to prevent tokens that support permit() from being able to gaslessly approve another account to transfer assets out of the rental safe. The current implementation prevents all eip-1271 signatures that originate from assets that are on the active whitelist, which is intended behavior.

Rental Creation Flow

The process of creating a rental has been slightly altered. Now, all tokens must be sent to the Create Policy when creating an order. From there, the Create Policy will perform accounting, set up the rental order, and then distribute the tokens to the correct parties.

Any vulnerabilities that can demonstrate that the assets go to the wrong addresses, pass execution flow to another account while in possession of the rented asset but before it has been registered by the protocol, or can break the internal accounting of the payment system will be much appreciated.

Vulnerabilities that stem from Seaport will be considered in scope if they can be demonstrated to directly affect this protocol

Maximum Rental Duration

A maximum rental duration has been introduced to prevent locking up assets for an unreasonable amount of time. Please assume that the maximum rental duration for any order is set to 21 days.

Replayability

Steps have been taken to prevent replayability of the co-signer's signature. Each RentPayload will now contain an order hash of the seaport order that it is intended for. Additionally, partial orders from seaport will not be supported by the protocol and will revert execution if a partial order is seen. With these two changes, we hope to ensure that one RentPayload can only be used one time and to fulfill only one unique seaport order.

Any vulnerabilities that can show the same RentPayload being used either with 2 different order hashes or the same order hash more than once will be welcomed.

Mitigations to be reviewed

Branch

https://github.com/re-nft/smart-contracts/tree/97e5753e5398da65d3d26735e9d6439c757720f5

Individual PRs

Wherever possible, mitigations should be provided in separate pull requests, one per issue. If that is not possible (e.g. because several audit findings stem from the same core problem), then please link the PR to all relevant issues in your findings repo.

URLMitigation ofPurpose
https://github.com/re-nft/smart-contracts/pull/7H-01, M-05, M-12Implements a whitelist so only granted assets can be used in the protocol
https://github.com/re-nft/smart-contracts/pull/17H-01, M-05, M-12Implements batching functionality for whitelisting tokens so that multiple can be added at once
https://github.com/re-nft/smart-contracts/pull/4H-02Adds check to prevent setting of the fallback handler by the safe owner
https://github.com/re-nft/smart-contracts/pull/14H-03, H-06Introduces an intermediary transfer on rental creation to ensure assets are not sent to the safe until they have been registered as rented by the protocol
https://github.com/re-nft/smart-contracts/pull/1H-04Fixes offset value so that the proper address is checked when disabling a gnosis module from a safe
-H-05Mitigation of this issue is the result of mitigating a handful of other findings (H-07, M-13, M-11, M-06)
https://github.com/re-nft/smart-contracts/pull/10H-07, M-13Prevents RentPayload replayability and ensures that orders must be unique by disallowing partial orders from seaport
https://github.com/re-nft/smart-contracts/pull/8M-01Allows distinction between rented and non-rented ERC1155 tokens. Renters should be able to transfer amounts of these tokens that do not cut into the active rented amount
https://github.com/re-nft/smart-contracts/pull/11M-02Introduces support for rented tokens that use Permit() for gasless approvals. The rental safe should now be able to prevent gasless signatures from approving rented assets
https://github.com/re-nft/smart-contracts/pull/9M-04onStart and onStop hook functions are now independent of one another and do not both need to be implemented at the same time.
https://github.com/re-nft/smart-contracts/pull/13M-06Checks if a rental order exists right away when stopping a rental. Prevents stopping of an order that doesnt exist, only to create it during a callback in the stopRent() execution flow
https://github.com/re-nft/smart-contracts/pull/5M-08Added support for burnable ERC721 and ERC1155 tokens
https://github.com/re-nft/smart-contracts/pull/6M-09Allows native ETH to be transferred out of a rental safe
https://github.com/re-nft/smart-contracts/pull/12M-10Introduces isActive check on the guard policy. Ensures that safes cannot use a guard that has been deactivated
https://github.com/re-nft/smart-contracts/pull/2M-11Properly implements EIP-712
https://github.com/re-nft/smart-contracts/pull/15M-16Introduces more granular controls over whitelist for extensions

Out of Scope

Please list any High and Medium issues that were judged as valid but you have chosen not to fix.