-
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
Some critical functions must be called only by the owner of the contract #877
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-303
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 10, 2023
c4-submissions
added a commit
that referenced
this issue
Nov 10, 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 19, 2023
141345 marked the issue as duplicate of #522 |
alex-ppg marked the issue as not a duplicate |
c4-judge
added
primary issue
Highest quality submission among a set of duplicates
and removed
duplicate-522
labels
Dec 1, 2023
alex-ppg marked the issue as primary issue |
c4-judge
added
duplicate-303
and removed
primary issue
Highest quality submission among a set of duplicates
labels
Dec 6, 2023
alex-ppg marked the issue as duplicate of #303 |
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-303
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#L448
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/NextGenCore.sol#L315
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/RandomizerNXT.sol#L41
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/RandomizerRNG.sol#L61
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/RandomizerVRF.sol#L94
Vulnerability details
In the 'MinterContract', 'NextGenCore', 'RandomizerNXT', 'RandomizerRNG', 'RandomizerVRF' contracts which have
updateCoreContract
,updateAdminContract
,addMinterContract
,updateRandomizerContract
functions are usingFunctionAdminRequired()
modifier meaning that only function or global admin can call them. These functions can be considered as critical and sensetive for the protocol. AlsoMinterContract
andRandomizerRNG
contracts haveemergencyWithdraw()
function withFunctionAdminRequired
modifier.By function admins and global admins having access to these functions they are able to take full control over the contracts and the whole protocol which is not safe.
Impact
Function and global admins having accees to critical and sensetive functions is not safe. Malicious admin can change the state of the contract or the whole protocol and gain full control.
Proof of Concept
Scenario 1:
Lets imagine that Bob becomes malicous function admin. Time has passed and MinterContract ETH balance is 100 ETH.
updateAdminContract(address _newadminsContract)
setting his own adminContractemergencyWithdraw()
NOTE:
RandomizerRNG
contract haveemergencyWithdraw()
function as well.Scenario 2:
NextGenCore
andMinterContract
contracts.updateAdminContract(address _newadminsContract)
in bothNextGenCore
andMinterContract
contracts.Recommended Mitigation Steps
Limit the access to all the critical and sensetive function to be called only by the owner of the contract.
Assessed type
Access Control
The text was updated successfully, but these errors were encountered: