Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA Report #81

Open
code423n4 opened this issue Mar 2, 2022 · 2 comments
Open

QA Report #81

code423n4 opened this issue Mar 2, 2022 · 2 comments
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

##Low
#Title : User might accidentally sent to market

Explanation : the Market contract preventing user to send eth directly to the contract by adding https://github.com/code-423n4/2022-02-foundation/blob/main/contracts/mixins/NFTMarketCore.sol#L36, however by calling withdrawFrom() with set the to parameter to market contract, then the market willingly except eth, since the msg.sender is feth, by adding check with require(to != address(market)) on withdrawFrom(), this can prevent user accidentally send etc to the market contract.

Navigation : https://github.com/code-423n4/2022-02-foundation/blob/main/contracts/FETH.sol#L418

#Title : Signature replay on NFTMarketPrivateSale

Explanation : A seller sign a message when the seller want to approve the buyer to buy the NFT, however there no nonce in place for the digest calculation, therefore in certain condition the buyer might buy the NFT again from the seller.

POC :

  1. The seller want to sell NFT id 1 for 1 ETH
  2. The seller sign a message to approve the buyer to buy NFT id 1 for 1 ETH
  3. The buyer get the NFT
  4. The buyer sell the NFT id 1 to the seller 1.2 ETH
  5. the seller want to sell the NFT id 1 for 2 ETH
  6. Since the signature that was given by the seller in the 2 step is still valid the buyer can buy the NFT id 1 for 1 ETH
  7. Buyer get the NFT with the old price.

Navigation : https://github.com/code-423n4/2022-02-foundation/blob/main/contracts/mixins/NFTMarketPrivateSale.sol#L162

@code423n4 code423n4 added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax bug Something isn't working labels Mar 2, 2022
code423n4 added a commit that referenced this issue Mar 2, 2022
@HardlyDifficult
Copy link
Collaborator

  • User might accidentally sent to market: Agree! Thanks for pointing this out. Users often make simple copy paste errors like this. We have added the recommended check.
  • Signature replay on NFTMarketPrivateSale: We have added a mapping to track already accepted terms to avoid any issues with signature replay.

@alcueca
Copy link
Collaborator

alcueca commented Mar 17, 2022

Unadjusted score: 30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

3 participants