The requestMintWeatherNFT function accepts a user-supplied heartbeat interval but fails to enforce a minimum value. If a caller specifies heartbeat = 0, the on-chain upkeep check will always evaluate to true immediately after minting. This permits continuous or spammed Chainlink Functions callbacks.
Location:
CheckUpkeep Logic:
With heartbeat == 0, this condition is true immediately after any prior timestamp is set.
Excessive Oracle Calls & Gas Drain
Chainlink Keeper network will repeatedly trigger performUpkeep, flooding the system with requests.
Rapid LINK depletion and high gas consumption by the registry.
Denial-of-Service (DoS)
Legitimate upkeep operations may fail once LINK funds are exhausted or the registry suspends the upkeep.
Economic Loss
Unexpected LINK and gas expenditures.
Potential for malicious actors to exploit zero-heartbeat mints, causing resource overconsumption.
High:
No on-chain validation prevents heartbeat = 0.
Any user can mint with a zero interval and immediately exploit the loophole.
Mint an NFT with heartbeat = 0.
Observe that checkUpkeep returns true immediately.
Chainlink Keepers continuously invoke performUpkeep.
The LINK balance depletes rapidly, disabling all further upkeep.
Add a require for a minimum heartbeat in requestMintWeatherNFT:
Optionally, set a higher minimum (e.g., MIN_HEARTBEAT = 60 seconds):
This ensures:
Prevention of sub-second or zero intervals that cause excessive upkeep calls.
Protection against rapid LINK and gas consumption.
This is informational. It is user's responsibility to provide correct input arguments. If the user provides incorrect arguments, it will lead to incorrect results, lost funds or failed transaction.
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.