Insufficient source of randomness #669
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
edited-by-warden
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/XRandoms.sol#L35-L43
Vulnerability details
Impact
RandomizerNXT uses XRandoms, which in turn uses
block.prevrandao
,blockhash()
andblock.timestamp
as a seed. These values are prone to manipulation and should not be used for deriving randomness.Proof of Concept
Once an adversary is able to determine a rule by which the NFT traits depend on the random number, and because these 3 variables can always be retrieved without changing the state of the protocol, he may delay his transaction until the seed for randomness yields a satifactory value.
Recommended Mitigation Steps
Use only ChainlinkVRF or Arrng as sources of randomness.
Assessed type
Other
The text was updated successfully, but these errors were encountered: