GivingThanks

First Flight #28
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

The poor value for the _createTokenURI function

Summary

The function _createTokenURI creates metadata for the tokenURI.

The function takes 3 arguments

msg.sender, block.timestamp, msg.value

and as a result returns base64Jsonstring.

Vulnerability Details

Using block.timestamp and msg.value as parameters for generating a tokenURI indeed poses several security risks, including susceptibility to manipulation by validators and vulnerability to front-running attacks.

Impact

Validators (miners) can manipulate the block.timestamp to a certain extent, affecting the randomness and potentially compromising the integrity of the tokenURI.

Since msg.value is publicly visible, an attacker can observe pending transactions and submit a similar transaction with a higher gas fee to execute it first, taking advantage of the predictable tokenURI.

Tools Used

manual review

Recommendations

Instead of relying on block.timestamp and msg.value, consider using more secure sources of randomness, such as Chainlink VRF (Verifiable Random Function).

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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