Weather Witness

First Flight #40
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: low
Likelihood: medium
Invalid

## WeatherNft.sol ## [ Heartbeat Interval check ]

Root + Impact

Description

The requestMintWeatherNFT function does not validate whether the _heartbeat value is above a reasonable threshold. Without this check, a user can set _heartbeat to 0 or an extremely low value, which can result in:

  • Unintended or rapid keeper executions

  • Excessive function calls or oracle triggers

  • Increased gas consumption and LINK depletion

  • Congestion of the keeper or automation logic

This can degrade the reliability and cost-efficiency of the system.

function requestMintWeatherNFT(
string memory _pincode,
string memory _isoCode,
bool _registerKeeper,
@> uint256 _heartbeat,
uint256 _initLinkDeposit
) external payable returns (bytes32 _reqId) {
}

Risk

Likelihood:

A user calling this function with _heartbeat = 0 will immediately cause the system to assume that the next keeper job is due, resulting in:

  • Immediate triggering of registered automation (if integrated)

  • Continuous triggering if no minimum enforcement exists

  • This behavior can be exploited repeatedly since the function is public and the check is missing.

Impact:

  • Wasted LINK gas

  • Network congestion

Proof of Concept

Recommended Mitigation

Add a constant in the contract to define the minimum allowed heartbeat interval. Then, in the requestMintWeatherNFT function, validate that the _heartbeat provided by the user meets or exceeds this threshold.

+ uint256 public constant MIN_HEARTBEAT_INTERVAL = 1 hours; // or suitable threshold
+ require(_heartbeat >= MIN_HEARTBEAT_INTERVAL, "Hearbeat too short");
Updates

Appeal created

bube Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

[Invalid] Lack of input validation in `requestMintWeatherNFT`

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.