MINTER_ROLE Can Be Granted By The Deployer and Mint Arbitrary Amount of Tokens
Summary
Using the mintToCaller() && mintByOwner() && mintByOwnerBatch() functions of ERC721NFTProduct && ERC1155NFTProduct respectively, an address with MINTER_ROLE can mint/burn an arbitrary amount of tokens.
Vulnerability Detail
If the private key of the deployer or an address with the MINTER_ROLE is compromised, the attacker will be able to mint an unlimited amount of tokens.
Consider removing the MINTER_ROLE, make the NFTs only mintable by the owner, and make the ERC721NFTProduct && ERC1155NFTProduct contract to be the owner and therefore the only minter.
0xNazgul
medium
MINTER_ROLE
Can Be Granted By The Deployer and Mint Arbitrary Amount of TokensSummary
Using the
mintToCaller() && mintByOwner() && mintByOwnerBatch()
functions ofERC721NFTProduct && ERC1155NFTProduct
respectively, an address withMINTER_ROLE
can mint/burn an arbitrary amount of tokens.Vulnerability Detail
If the private key of the deployer or an address with the
MINTER_ROLE
is compromised, the attacker will be able to mint an unlimited amount of tokens.Impact
This poses a serious centralization risk.
Code Snippet
ERC721NFTProduct.sol#L107
,ERC1155NFTProduct.sol#L259
,ERC1155NFTProduct.sol#L279
Tool used
Manual Review
Recommendation
Consider removing the
MINTER_ROLE
, make the NFTs only mintable by the owner, and make theERC721NFTProduct && ERC1155NFTProduct
contract to be the owner and therefore the only minter.