-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad source of randomness #163
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
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Comments
c4-submissions
added
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
labels
Nov 2, 2023
c4-pre-sort
added
the
primary issue
Highest quality submission among a set of duplicates
label
Nov 15, 2023
141345 marked the issue as primary issue |
This was referenced Nov 15, 2023
Closed
This was referenced Nov 17, 2023
Closed
a2rocket (sponsor) disputed |
c4-sponsor
added
the
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
label
Nov 23, 2023
This was referenced Nov 25, 2023
Open
Open
Closed
Closed
Closed
Closed
Open
Closed
141345 marked the issue as sufficient quality report |
c4-pre-sort
added
the
sufficient quality report
This report is of sufficient quality
label
Nov 27, 2023
alex-ppg marked the issue as duplicate of #1901 |
c4-judge
added
duplicate-1901
and removed
primary issue
Highest quality submission among a set of duplicates
labels
Dec 4, 2023
alex-ppg marked the issue as unsatisfactory: |
c4-judge
added
the
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
label
Dec 5, 2023
alex-ppg marked the issue as unsatisfactory: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
sufficient quality report
This report is of sufficient quality
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
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/XRandoms.sol#L40
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/RandomizerNXT.sol#L57
Vulnerability details
Impact
The custom made randomizer contract RandomizerNXT uses on chain randomness which can be gamed to mint NFTs with a certain rarity or desired feature.
An attacker can predetermine the result of calculateTokenHash() and only choose to mint if the result is desirable.
Proof of Concept
In this example we use a fixed price sale where NFTs are sold for 1 ETH.
The attacker calculates the hash and only mints if the result is favourable to them.
Tools Used
Foundry
Recommended Mitigation Steps
The solution which is to use a more secure source of randomness is already implemented in the 2 other randomizers that use VRF's.
This means the weak randomness from RandomizerNXT and XRandoms is redundant and can be safely removed.
Assessed type
Other
The text was updated successfully, but these errors were encountered: