-
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 function-level admins can escalate their own roles to drain all funds from NextGenMinterContract
#1457
Comments
141345 marked the issue as sufficient quality report |
141345 marked the issue as remove high or low quality report |
141345 marked the issue as duplicate of #303 |
141345 marked the issue as not a duplicate |
141345 marked the issue as sufficient quality report |
a2rocket (sponsor) disputed |
all admins are trusted roles. |
alex-ppg marked the issue as duplicate of #1922 |
alex-ppg marked the issue as unsatisfactory: |
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/NextGenCore.sol#L322
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/MinterContract.sol#L461
Vulnerability details
Impact
At the outset, it must be acknowledged that the NextGen team considers all admin roles to be trusted, and findings related to an admin abusing their defined role are not valid. However, an admin having the ability to escalate their own role unilaterally and execute functionality they were not approved to execute — even if only a malicious admin would exercise this ability — should be considered a serious vulnerability. This is even more true if this vulnerability is exploitable for major monetary gain, as is the case here.
Because the
owner
of theNextGenAdmins
contract is treated as a global admin throughout the system, anyFunctionAdmin
with the authority toupdateAdminContract
(L454,NextGenMinterContract
) can deploy their own admin contract, replace the old one, and drain all the funds from the minter contract by callingemergencyWithdraw
(L461,NextGenMinterContract
).Even considering the team's intent to only use multisigs as admins, the balance of
NextGenMinter
could very easily get high enough to tempt more than one possible attacker. And regardless, functionality with as much risk asemergencyWithdraw
must be handled with the absolute highest level of care — and that means there should not be any implicitly defined access to it. Such caveats are bound to be forgotten or overlooked, especially by future developers who join the NextGen team and external maintainers of forks (such as UNIC at launch).Proof of Concept
Recommended mitigation
Consider treating
updateAdminContract
andemergencyWithdraw
both as especially high-security functions: explicitly define who can access these functions, and under what circumstances. It would also be worthwhile to implement a multi-party approval system for these functions, as seen inNextGenMinterContract
when proposing addresses and percentages.Assessed type
Access Control
The text was updated successfully, but these errors were encountered: