Bad source of randomness #662
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-1901
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/2467db02cc446374ab9154dde98f7e931d71584d/smart-contracts/XRandoms.sol#L41
Vulnerability details
Impact
Using
block.number
andblock.timestamp
as a source of randomness is commonly advised against, as the outcome can be manipulated by calling contracts. In this case,minter can get the word he likeProof of Concept
This code get random by
block.number
andblock.timestamp
Malicious user is able to predict result and get the word nft he want
Tools Used
manual
Recommended Mitigation Steps
Consider using a decentralized oracle for the generation of random numbers, such as Chainlinks VRF.
Assessed type
Other
The text was updated successfully, but these errors were encountered: