Access control in NextGenMinterContract
can be bypassed by the function admin of NextGenCore#addMinterContract()
#537
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-303
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/hardhat/smart-contracts/NextGenCore.sol#L315-L318
Vulnerability details
Impact
The function admin of
NextGenCore#addMinterContract()
can arbitrarily mint or burn any NFT.Proof of Concept
The function admin of
NextGenCore#addMinterContract()
has the capability to updateminterContract
, which is an extremely crucial component within NextGen:By having the privilege to update the minterContract, the function admin can create a smart contract without any restrictions to replace it. This malicious smart contract can then mint or burn NFTs, potentially leading to profit for the function admin and causing significant losses for NFT holders and artists.
Create MaliciousMinterContract:
Copy below cods into nextGen.test.js and run
npx hardhat test
:Tools Used
Manual review
Recommended Mitigation Steps
Consider that
NextGenMinterContract
is an extremely crucial component within NextGen, it is recommended to maintainminterContract
as immutable, or no one can update it except global admin.Assessed type
Access Control
The text was updated successfully, but these errors were encountered: