LooksRare Aggregator contest - carrotsmuggler's results

An NFT aggregator protocol.

General Information

Platform: Code4rena

Start Date: 08/11/2022

Pot Size: $60,500 USDC

Total HM: 6

Participants: 72

Period: 5 days

Judge: Picodes

Total Solo HM: 2

Id: 178

League: ETH

LooksRare

Findings Distribution

Researcher Performance

Rank: 6/72

Findings: 3

Award: $3,864.16

QA:
grade-b

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Findings Information

🌟 Selected for report: 0xSmartContract

Also found by: carrotsmuggler

Labels

bug
2 (Med Risk)
disagree with severity
satisfactory
duplicate-127

Awards

3750.5995 USDC - $3,750.60

External Links

Lines of code

https://github.com/code-423n4/2022-11-looksrare/blob/e3b2c053f722b0ca2dce3a3eb06f64859b8b7a6f/contracts/TokenRescuer.sol#L14-L39 https://github.com/code-423n4/2022-11-looksrare/blob/e3b2c053f722b0ca2dce3a3eb06f64859b8b7a6f/contracts/OwnableTwoSteps.sol#L125-L127

Vulnerability details

Impact

Contract TokenRescuer inherits the contract OwnableTwoSteps but does not set any delay. There should be a constructor in TokenRescuer responsible for setting the delay as described in the comments of the OwnableTwoSteps contract. Without any delay, ownership can be changed/revoked within a single block.

Proof of Concept

contract TokenRescuer is OwnableTwoSteps, LowLevelETH, LowLevelERC20Transfer {
    error InsufficientAmount();
    
   // @audit: Missing constructor/ call to _setupDelayForRenouncingOwnership

    function rescueETH(address to) external onlyOwner
    function rescueERC20(address currency, address to) external onlyOwner
}

Tools Used

forge

Add a constructor to TokenRescuer setting a delay of 1 day for ownership changes/revoking.

#0 - c4-judge

2022-11-21T11:52:20Z

Picodes marked the issue as primary issue

#1 - c4-judge

2022-11-21T16:41:32Z

Picodes marked the issue as satisfactory

#2 - c4-sponsor

2022-11-24T12:42:45Z

0xhiroshi marked the issue as disagree with severity

#3 - 0xhiroshi

2022-11-24T12:44:46Z

valid but it sounds like a low risk to me (also we are going to time delay completely)

#4 - Picodes

2022-12-11T12:31:15Z

To me this is a case of "break of functionality" where the intent of the code is clearly to have a two step ownership transfer but it is not. As this safeguard may be important for decision-making (e.g. giving an unlimited approval to ERC20EnabledLooksRareAggregator), I think Medium severity is appropriate.

#5 - 0xhiroshi

2022-12-12T09:14:28Z

To me this is a case of "break of functionality" where the intent of the code is clearly to have a two step ownership transfer but it is not. As this safeguard may be important for decision-making (e.g. giving an unlimited approval to ERC20EnabledLooksRareAggregator), I think Medium severity is appropriate.

Ok

#6 - C4-Staff

2022-12-20T23:47:34Z

JeeberC4 marked the issue as duplicate of #127

Findings Information

Awards

77.2215 USDC - $77.22

Labels

bug
2 (Med Risk)
satisfactory
duplicate-277

External Links

Lines of code

https://github.com/code-423n4/2022-11-looksrare/blob/e3b2c053f722b0ca2dce3a3eb06f64859b8b7a6f/contracts/LooksRareAggregator.sol#L241-L251

Vulnerability details

Impact

The TokenRescuer contract helps to rescue eth and erc20 tokens and can only be called by the owner. However, any trapped eth or erc20 tokens can actually be taken out by anyone. Essentially the function and access control of the TokenReceiver contract can be bypassed. This can be a low risk issue, but classified as med since it directly bypasses some access control.

Proof of Concept

  1. List any bogus nft for any price
  2. Use ERC20EnabledLooksRareAggregator and include the erc20 token you want to get out of the contract in the tokenTransfers array
  3. After purchasing the listed nft, all erc20 tokens and ETH in the contract will be sent to the receiver as long as it was included in the tokenTransfers array

Tools Used

foundry

Store the purchase price of the NFT and the credited amount and only return the balance difference, not the entire contract balance.

#0 - c4-judge

2022-11-20T10:43:38Z

Picodes marked the issue as duplicate of #277

#1 - c4-judge

2022-12-16T14:02:06Z

Picodes marked the issue as satisfactory

Awards

36.3434 USDC - $36.34

Labels

bug
grade-b
QA (Quality Assurance)
sponsor disputed
edited-by-warden
Q-36

External Links

1. LooksRareAggregator fee can be set to 10000bp

LooksRareAggregator only checks if the set fee bp <= 10000. This allows instances of 10000bp fees, or 100% fees.

2. ERC20EnabledAggregator doesnt have recovery option

LooksRareAggregator has token recovery options for erc20, erc721 and erc1155. However ERC20EnabledAggregator does not have recovery options for any of them. It is unlikely ERC20EnabledAggregator will ever come across erc721 or erc1155, but it is quite likely some user might send erc20 to the contract by mistake which will become unrecoverable.

3. WETH returns for ETH purchases wont be returned

If protocol returns WETH on ETH purchases, they wont be returned to the user

#0 - c4-judge

2022-11-21T19:14:10Z

Picodes marked the issue as grade-b

#1 - c4-sponsor

2022-11-24T23:06:44Z

0xhiroshi marked the issue as sponsor disputed

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