The NFT collection should return token metadata only for NFTs that have been minted. Queries for nonexistent token IDs should revert, consistent with ERC721 metadata expectations.
However, tokenURI ignores its tokenId argument and always returns TOKEN_URI. Any caller can request metadata for arbitrary, unminted token IDs.
Likelihood:
Marketplaces, indexers, and users commonly query tokenURI for token IDs when displaying NFT metadata.
Any caller can query arbitrary token IDs, including IDs beyond the collection’s minted supply.
Impact:
Metadata is returned for NFTs that do not exist.
Marketplaces and indexers can display misleading NFT information or treat unminted token IDs as valid collection items.
Applying this function at the end of /test/SantasListTest.t.sol to see how tokenUri string is constant for all tokens , minted or not
Ran with command: forge test --match-test testPoC_TokenURIReturnsDataForNonexistentNFT -vvvv
Validate that the token exists before returning its metadata.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.