The lack of check in the WeatherNft::performUpkeep
function allows to call a performUpkeep on a tokenId that is not minted yet. This can lead to a situation where the s_weatherNftInfo::infoLastFulfilledAt
is updated for tokenId that are not minted yet.
The performUpkeep
function does not check if the tokenId is minted before calling performUpkeep. This means the contract can call performUpkeep on a tokenId that is not minted yet. This can lead to a situation where the s_weatherNftInfo::infoLastFulfilledAt
is updated for tokenId that are not minted yet.
Likelihood: LOW
It is improbable that a user will call performUpkeep on a tokenId that is not minted yet.
Impact: LOW
The s_weatherNftInfo::infoLastFulfilledAt
param is however overwritten when the tokenId will be minted.
The attacker calls performUpkeep performUpkeep
on a tokenId that is not minted yet.
The contract requests the weather update for the tokenId that is not minted yet.
The contract updates the s_weatherNftInfo::infoLastFulfilledAt
for the tokenId with block.timestamp actual value.
Consider adding a check to ensure that the nft exists before calling performUpkeep.
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.