WeatherNft::fulfillMintRequest() function , leading to NFT Hijacking/Unauthorized NFT MintingThe fulfillMintRequest() function allows anyone to call it and complete the minting process after the Chainlink Functions request is fulfilled. When minting the NFT, the contract uses msg.sender as the recipient rather than the original requester who paid for the mint. This creates a critical vulnerability where attackers can front-run legitimate users' mint fulfillment transactions and receive their NFTs despite not paying the mint price.
Any user can monitor pending mint requests and steal NFTs by front-running the original requester's fulfillment transaction. The original requester still pays the mint price but receives nothing, resulting in direct financial loss.\
Put the below file inside a test file.
Run it using : forge test --fork-url $AVAX_FUJI_RPC_URL --via-ir -vvvvv
Modify the fulfillMintRequest() function to mint the NFT to the original requester instead of the transaction sender:
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.