-
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
Denial of Service (DoS) in mintAndAuction for collection using Sale Mode 1: Fixed Price Sale #1505
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-1980
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Comments
c4-submissions
added
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
labels
Nov 13, 2023
141345 marked the issue as sufficient quality report |
c4-pre-sort
added
the
sufficient quality report
This report is of sufficient quality
label
Nov 16, 2023
141345 marked the issue as duplicate of #1278 |
141345 marked the issue as duplicate of #962 |
141345 marked the issue as not a duplicate |
141345 marked the issue as duplicate of #1278 |
alex-ppg marked the issue as duplicate of #1980 |
alex-ppg marked the issue as unsatisfactory: |
c4-judge
added
the
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
label
Dec 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-1980
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/main/smart-contracts/MinterContract.sol#L276-L298
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/MinterContract.sol#L157-L166
Vulnerability details
Risk Level: High
Links to affected code:
Vulnerability details
Impact
Unable to create the auction for the collection using sales mode 1, Fixed Price Sale, as it leads to a division by zero error at Line 292.
Detail
The
mintAndAuction
function allows function admin to create one auction per period:However, the
timePeriod
used to calculatetDiff
at Line 292 purposely refers to the time period that affects the minting price of collections using sale mode 2 or 3 (Exponential/Linear Descending Sale and Periodic Sale, respectively). This value is set tozero
when the collection uses sale mode 1 (Fixed Price Sale).https://seize-io.gitbook.io/nextgen/nextgen-smart-contracts/minter
As a result, collections using sale mode 1 are unable to create auctions, as the calculation of
tDiff
will lead to a division by zero, causing the transaction to revert.Proof of Concept
Assuming Collection ID: 1 is the target for the Proof of Concept (PoC):
mintAndAuction
with_collectionID
as 1.timePeriod
is set to 0.Resources:
Screenshot of result:
Tools Used
Recommended Mitigation Steps
Consider updating the
mintAndAuction
function to handle all possible scenarios.Specifically, introduce a new variable, such as
auctionTimePeriod
, distinct from thetimePeriod
purposely used to calculate sale prices in sale mode 2 or 3.This new variable will be specifically utilized within the context of the
mintAndAuction
function, ensuring accurate calculations and preventing division by zero errors for collections using sale mode 1.Assessed type
DoS
The text was updated successfully, but these errors were encountered: