-
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
MinterContract.mint division by zero #1927
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-1980
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 13, 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
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-1980
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/MinterContract.sol#L249
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/MinterContract.sol#L292
Vulnerability details
Impact
The users would not be able to mint tokens if it implies a periodic sales model with the time period set to zero or not set. Also, the admins would be unable to mint and auction for the same reason.
Proof of Concept
Let's suppose the following scenario takes place:
setCollectionCosts
.mint
function; however, it will always revert withwith panic code 0x12 (Division or modulo division by zero)
, which does not provide any context and users/admins without technical background would not be able to recognise the source of issue.The reason is hidden in the evaluation if a period has passed to allow minting. Instances:
249, 292
Tools Used
Manual Review
Recommended Mitigation Steps
In
setCollectionCosts
, add a check for the_timePeriod
parameter to be above zero if_salesOption
equals 3. For instance:Assessed type
Error
The text was updated successfully, but these errors were encountered: