Infinity NFT Marketplace contest - Lambda's results

The world's most advanced NFT marketplace.

General Information

Platform: Code4rena

Start Date: 14/06/2022

Pot Size: $50,000 USDC

Total HM: 19

Participants: 99

Period: 5 days

Judge: HardlyDifficult

Total Solo HM: 4

Id: 136

League: ETH

Infinity NFT Marketplace

Findings Distribution

Researcher Performance

Rank: 36/99

Findings: 4

Award: $175.61

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

11.084 USDC - $11.08

Labels

bug
duplicate
3 (High Risk)
sponsor confirmed

External Links

Lines of code

https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/core/InfinityExchange.sol#L1229 https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/staking/InfinityStaker.sol#L345

Vulnerability details

Impact

InfinityExchange.sol and InfinityStaker.sol contain a function rescueETH (InfinityExchange.sol#L1229 and InfinityStaker.sol#L345) to rescue any ETH that is accidentally sent to the contract. However, these functions do not have an amount parameter and just send msg.value to the destination, i.e. the amount that was just sent to the function. Rescuing accidentally sent ETH is therefore not possible with these functions.

Add an amount parameter to rescueETH.

#0 - nneverlander

2022-06-22T11:18:08Z

Duplicate

#1 - HardlyDifficult

2022-07-10T14:59:13Z

Findings Information

Labels

bug
duplicate
3 (High Risk)
upgraded by judge

Awards

84.0967 USDC - $84.10

External Links

Judge has assessed an item in Issue #129 High risk. The relevant finding follows:

InfinityExchange.sol#L326 and InfinityExchange.sol#L362: When a user pays too much ETH, the additional cost is not reimbursed (in contrast to ERC20 transfers, where this is not possible). Consider reimbursing the user (like other NFT marketplaces, e.g. Rarible) when he pays too much ETH.

#0 - HardlyDifficult

2022-07-14T01:19:45Z

  • InfinityExchange.sol#L525: address(0) has to be added as a valid currency, otherwise isOrderValid will fail. Consider hardcoding address(0) as a valid currency, because it always is for sell orders according to the rest of the contract
  • InfinityExchange.sol#L412: isNonceValid will fail, even when the nonce would be valid, because userMinOrderNonce[user] is 0 initially. Therefore, the check nonce > userMinOrderNonce[user] fails. Consider handling this case of an uninitialized userMinOrderNonce[user] or documenting this requirement explicitly.
  • InfinityExchange.sol#L484: The documentation states that verifyMatchOrders "checks if the given complication can execute this order", which is not done. Consider updating the description to reflect the real behavior.
  • InfinityStaker.sol#L310: amount > vestedTwelveMonths can and should never happen because of InfinityStaker.sol#L123, where it is checked that the sum of the vested tokens is larger than or equal to amount. The code can therefore be removed or a revert (when the function is used from other places in the future) could be added.
  • InfinityStaker.sol#L72: The timestamp is reset for all staked tokens with the given duration when additional tokens are staked. This can disincentivize staking for some users, which is not desirable for the market place. For example, when a user has staked some tokens already for 10 months (with a duration of 12 months), he probably will not stake additional tokens, because the timer for all tokens is reset. A better solution would be to have timestamps for every deposit.
  • InfinityExchange.sol#L326 and InfinityExchange.sol#L362: When a user pays too much ETH, the additional cost is not reimbursed (in contrast to ERC20 transfers, where this is not possible). Consider reimbursing the user (like other NFT marketplaces, e.g. Rarible) when he pays too much ETH.

#0 - nneverlander

2022-06-23T12:36:16Z

Thanks

#1 - HardlyDifficult

2022-07-14T01:19:27Z

Moved the last item to #368

  • SignatureChecker.sol#L32: This check is actually not needed and performed by ecrecover. See https://twitter.com/alexberegszaszi/status/1534461421454606336 for an extensive discussion.
  • InfinityStaker.sol: In #L301, #L305, and #L309, the subtractions can be unchecked because there is already a check for underflow before the statements.

#0 - nneverlander

2022-06-23T12:37:00Z

Thanks

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