In normal behavior, a user calls the requestMintWeatherNFT()
function to mint a Weather NFT. They send the required ETH for minting and optionally deposit LINK tokens if they want automation via Chainlink Keepers. The function triggers a weather data request using Chainlink Functions. Later, when the response is ready, the fulfillMintRequest()
function is expected to be called, which uses the data to mint an NFT to the user who originally requested it.
However, the contract does not verify the identity of the original requester during the fulfillMintRequest()
call. This allows anyone, including an attacker, to call this function with a valid requestId
— even if they didn’t pay or request the NFT. When they do this, the contract mints the NFT to the attacker's address, since msg.sender
is used during minting without any verification.
Likelihood:
This will happen whenever a malicious actor monitors the blockchain for pending NFT requests and sees a valid requestId
. Since the fulfillMintRequest()
function is public and lacks access control, anyone can call it at the right time.
The attacker can easily wait for the Chainlink response to be ready (by checking if response.length > 0
) and then call the function before the legitimate user or Chainlink does.
Impact:
The NFT gets minted to the attacker instead of the legitimate user.
The user loses both the ETH minting fee and LINK deposit.
The attacker receives an NFT for free, breaking the trust and fairness of the minting process.
Always store the original requester’s address when the mint request is made, and use that stored address when minting. Do not use msg.sender
inside fulfillMintRequest()
.
There is no check to ensure that the caller of the `fulfillMintRequest` function is actually the owner of the `requestId`. This allows a malicious user to receive a NFT that is payed from someone else.
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.