FestivalPass::uri
The function may return URIs for non-existent or invalid tokensThe uri(uint256 tokenId)
function returns the URI associated with a token, distinguishing between regular passes (tokenId <= BACKSTAGE_PASS
) and memorabilia (tokenId
encoded with collectionId
+ itemId
).
If the tokenId
does not match either case, the function returns super.uri(tokenId)
, using the base URI defined in the constructor. This may result in apparently valid URIs being returned for non-existent tokenId
s.
Likelihood: Medium
Services like marketplaces could display false metadata for non-existent tokenIds, causing user confusion.
Impact: Low
Although there is no direct risk of financial loss or security vulnerability, this behavior can cause functional confusion and a poor user experience. If a URI is returned for a non-existent tokenId, interfaces like marketplaces (OpenSea, etc.) or NFT explorers could display incorrect metadata, suggesting the token exists when it does not.
This can cause uncertainty for users, hinder contract debugging, and create false trust in assets that have not been created or authorized.
This test verifies that the uri()
function returns a URI even for a tokenId
that has never been minted or does not correspond to a valid pass or memorabilia item.
Add explicit validation to ensure the tokenId actually exists before returning a URI
. If it is not a valid pass or an existing memorabilia
, the function should revert
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.