The AccountNFT contract does not check for the existence of a tokenId before minting a new NFT. This can lead to the minting of duplicate NFTs with the same tokenId, causing data integrity issues and potentially being exploited by attackers.
In the mint function, there is no mechanism to ensure that the tokenId has not been used before. When an NFT is minted with an existing tokenId, it will overwrite the existing NFT, leading to data loss and potentially other unintended consequences.
https://github.com/Cyfrin/2024-07-zaros/blob/main/src/account-nft/AccountNFT.sol#L18-L21
Users could lose their NFTs if a new NFT is minted with the same tokenId.
Manual review
Add logic to the mint function to check if the tokenId already exists before minting. This can be done by using a mapping to store used tokenIds.
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.