The CurrencyManager contract has a vulnerability in the constructor where the grantRole
function calls are missing the onlyRole(ADMIN_ROLE)
modifier. This allows any address to grant the ADMIN_ROLE
to other addresses, effectively bypassing the intended access control mechanism.
The vulnerability is present in the constructor of the CurrencyManager contract:
The grantRole
function calls are not protected by the onlyRole(ADMIN_ROLE)
modifier, which means any address can call these functions and grant the ADMIN_ROLE
to other addresses.
This vulnerability can lead to a privilege escalation attack, where a malicious actor can grant themselves the ADMIN_ROLE
and then perform unauthorized actions, such as adding or removing currencies from the whitelist.
The vulnerability was identified through a manual code review of the CurrencyManager contract.
To fix the vulnerability, the grantRole
function calls in the constructor should be wrapped with the onlyRole(ADMIN_ROLE)
modifier, like this:
This will ensure that only the ADMIN_ROLE
accounts can grant the ADMIN_ROLE
to other addresses, maintaining the intended access control mechanism.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.