The mint
function in RAACNFT contract is vulnerable to front-running attacks, allowing malicious actors to deny service to legitimate users by intercepting their mint transactions.
The mint
function accepts a user-specified _tokenId
that the user wants to mint. This creates an opportunity for attackers to front-run legitimate transactions by:
Monitoring the mempool for mint transactions
Copying the transaction with a higher gas price
Minting the same NFT before the original user
Causing the original transaction to fail
The issue is particularly problematic because:
Users can't guarantee they'll receive their desired NFT
Malicious actors can systematically front-run all mint transactions
No protection mechanisms are implemented
This vulnerability:
Can effectively DoS the minting process for legitimate users
Damages user experience and platform reliability
May lead to user financial losses due to failed transactions and gas costs
Could render the minting functionality practically unusable for regular users
Manual review
Add the following test case to the test/unit/core/tokens/RAACNFT.test.js
file:
Consider implement merkle tree pre assigning the NFTs to users by some owner role, or include a message signed off-chain by some authenticated authority, or remove the _tokenId
parameter and use a random number generator to select the NFT to mint.
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.