Lack of Input Validation in WeatherNft::performUpkeep
.
Impact: Low to Medium severity—incorrect state updates could disrupt automation logic.
The WeatherNft.sol::performUpkeep
function is called by Chainlink Keepers to update an NFT’s weather data. It decodes performData
to get a _tokenId
but doesn’t validate if the NFT exists or if the upkeepId
is valid, leading to incorrect state updates (e.g., lastFulfilledAt
) for non-existent NFTs, which could interfere with valid automation.
Likelihood:
Chainlink Keepers call performUpkeep
with an invalid _tokenId
(e.g., for an un-minted NFT).
An attacker spams performUpkeep
with invalid data to manipulate state.
Impact:
Incorrect lastFulfilledAt
updates for non-existent NFTs waste gas and could delay updates for valid NFTs.
Off-chain systems may misinterpret state, affecting user experience.
Scenario: Call performUpkeep
with invalid tokenId
Result: s_weatherNftInfo[9999].lastFulfilledAt
is updated, wasting gas
Add validation to the performUpKeep
function to ensure the NFT exists:
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.