[WP-H3] MINTER_ROLE
of VUSD
can rug users with unlimited mint()
#98
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2022-02-hubble/blob/ed1d885d5dbc2eae24e43c3ecbf291a0f5a52765/contracts/VUSD.sol#L11-L11
Vulnerability details
https://github.com/code-423n4/2022-02-hubble/blob/ed1d885d5dbc2eae24e43c3ecbf291a0f5a52765/contracts/VUSD.sol#L11-L11
https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.3.2/contracts/token/ERC20/presets/ERC20PresetMinterPauserUpgradeable.sol#L67-L70
The address that
initialize()
the VUSD contract, usually, the deployer of the contract will haveMINTER_ROLE
by default, furthermore, the deployer and any other address with theDEFAULT_ADMIN_ROLE
can grantMINTER_ROLE
to anyone with no reactions.We believe this can introduce a severe centralization risk, which can cause users to be rugged by the malicious/compromised deployer or other addresses with
MINTER_ROLE
.https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v4.3.2/contracts/token/ERC20/presets/ERC20PresetMinterPauserUpgradeable.sol#L51-L56
Recommendation
Consider limiting power of the deployer, including:
MINTER_ROLE
should only be held by contracts but not EOAs;MINTER_ROLE
should not be granted in one step by an EOA, but in 2 steps and it should be granted by a multi-sig or DAO gov contract only.The text was updated successfully, but these errors were encountered: