The fulfillMintRequest function in the WeatherNft contract is designed to allow users to mint their NFT after a Chainlink oracle has provided weather data for their request. Normally, only the original requester who paid for the mint should be able to call this function and receive the NFT.
The specific issue is that the function lacks proper access control checks, allowing any address to call fulfillMintRequest with a valid requestId. Instead of minting the NFT to the original requester stored in s_funcReqIdToUserMintReq[requestId].user, the function uses msg.sender as the recipient. This allows attackers to front-run legitimate users and steal their NFTs after paying nothing.
Likelihood: High
No special permissions or complex setup is required - any external address can exploit this vulnerability
Impact: high
Direct NFT theft where attackers can steal NFTs from legitimate users who have paid for them, resulting in financial loss for users and reputational damage for the protocol
To fix the access control vulnerability in fulfillMintRequest, implement proper validation to ensure only the original requester can claim their NFT:
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.