-
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
Use of NextGenAdmins
in all contracts that define an adminsContract
is flawed and any Admin
can become the owner of adminsContract
#303
Comments
141345 marked the issue as sufficient quality report |
141345 marked the issue as primary issue |
a2rocket (sponsor) disputed |
this is the intended design, owner of the NextGenAdmins contract can set Admins which are fully trusted. |
The Warden specifies a way whereby a function administrator can escalate themselves to be a global administrator. This falls under suitable findings per the relevant Centralization Risks Supreme Court verdict, however, I am inclined to mark this as a non-issue. The reasoning behind this judgment is that a function administrator is expected to have complete access to the relevant function, and the As such, a function administrator of that particular function is considered to be identical to a global administrator in my viewpoint given the responsibilities associated with the function. I believe this finding to be better suited for an Analysis review / QA (NC) and thus of overinflated severity. To note, all duplicated issues of this exhibit do not refer to privilege escalation, they instead pertain to various centralization abuses that fall under the same SC ruling and thus are considered invalid. If necessary, this finding and its duplicates will be split into separate issues but for now, the whole group falls under centralization risks and is invalid. |
alex-ppg marked the issue as unsatisfactory: |
alex-ppg marked the issue as unsatisfactory: |
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/NextGenCore.sol#L322-L325
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/MinterContract.sol#L454-L457
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/RandomizerNXT.sol#L45-L47
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/RandomizerVRF.sol#L94-L97
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/RandomizerRNG.sol#L61-L64
Vulnerability details
Let’s take the example of
RandomizerNXT
for the sake of simplicity.Impact
In
RandomizerNXT.sol
andAdmin
ofadminsContract
can design himself as a function admin for theupdateAdminContract
function and update the admin contract to one he is the owner of.This defeats the whole purpose of the
onlyOwner
modifier in theregisterAdmin
function inNextGenAdmins.sol
This is marked as MEDIUM as the probability of a malicious
Admin
is moderate.Proof of Concept
When the
RandomizerNXT.sol
contract is initially deployed, theadminsContract
is set in the constructor.In this
NextGenAdmins
, theowner()
and only theowner()
is able to designate globalAdmins
via theregisterAdmin
function as defined belowLet’s put ourselves in the situation where a global
Admin
has been chosen by theowner()
.This
Admin
should be able to defineFunctionAdmins
with theregisterFunctionAdmin
function as defined belowbut should NOT be able to register other
global Admins
as theregisterAdmin
function uses theonlyOwner
modifier.However,
Admin
can declare themselves as aFunction Admin
for theupdateAdminsContract
function, meaning he is able to update theadminsContract
to a contract from which he is theowner()
and where he can nominateglobal Admins
.Tools Used
Manual review / Visual Studio
Recommended Mitigation Steps
The
updateAdminsContract
function should use anOwnerRequired
modifier instead of theFunctionAdminRequired(this.updateAdminsContract.selector)
modifier it is currently using.This
OwnerRequired
modifier could look like the belowThis would ensure that admins are not able to replace the owner and result in stronger access control.
Assessed type
Governance
The text was updated successfully, but these errors were encountered: