Platform: Code4rena
Start Date: 11/08/2022
Pot Size: $40,000 USDC
Total HM: 8
Participants: 108
Period: 4 days
Judge: hickuphh3
Total Solo HM: 2
Id: 152
League: ETH
Rank: 4/108
Findings: 2
Award: $2,896.65
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: itsmeSTYJ
Also found by: 0x1f8b, 0x52, 0xDjango, Ch_301, Chom, KIntern_NA, PwnedNoMore, Treasure-Seeker, auditor0517, byndooa, cccz, csanuragjain, ladboy233, nine9, shenwilly, thank_you, yixxas, zkhorse
42.8343 USDC - $42.83
It is designed to cap one buys per account by limitperAccount configured during when sale is created. It should revert with NFTDropMarketFixedPriceSale_Cannot_Buy_More_Than_Limit() if (IERC721(nftContract).balanceOf(msg.sender) + count > saleConfig.limitPerAccount) Thus to pass this check IERC721(nftContract).balanceOf(msg.sender) should be minimized. It is very easy to do in one transaction, if buyer is a smart-contract (buy->transfer->buy->transfer) As the result, anyone can buy as much NFT as he wish, even all the collection. But the seller expect that the limit works.
Steps - in one transaction from a smart-contract:
Hardhat
Options:
#0 - HardlyDifficult
2022-08-17T20:56:57Z
https://github.com/code-423n4/2022-08-foundation/blob/792e00df429b0df9ee5d909a0a5a6e72bd07cf79/contracts/mixins/nftDropMarket/NFTDropMarketFixedPriceSale.sol#L118-L157 https://github.com/code-423n4/2022-08-foundation/blob/792e00df429b0df9ee5d909a0a5a6e72bd07cf79/contracts/mixins/nftDropMarket/NFTDropMarketFixedPriceSale.sol#L170-L219
In the https://os.foundation.app/docs/creator-tools/drop we can outline that:
NFTDropMarket perfectly takes payments from buyers, but do not check if the mint is successful after the payment. Mints will be ok if NFT contracts are deployed through NFTCollectionFactory.sol, but for malicious NFT it is not a guarantee. Check for interface implemented are not enough.
NFTDropMarket function only checks that the NFT implements INFTDropCollectionMint interface. But for malicious NFT contracts it is still too many options to write something bad - like mining 0 NFTs, after taking payments on NFTDropMarket. So the steps are:
Hardhat
in NFTDropMarket.mintFromFixedPriceSale() check that the mint happened (like balanceOf check, or anything else) Or consider additional checks when adding NFTs to sales in NFTDropMarket.createFixedPriceSale()
#0 - 0xlgtm
2022-08-17T03:42:08Z
Similar but not exact dup of https://github.com/code-423n4/2022-08-foundation-findings/issues/267
#1 - HardlyDifficult
2022-08-19T11:40:45Z