Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Invalid

'BoostController.sol::modifySupportedPool' adding address check to the function

Summary

' BoostController.sol::modifySupportedPool' adding an address check will secure the code from malicious attacker gained MANAGER_ROLE.

Vulnerability Details

function modifySupportedPool(address pool, bool isSupported) external onlyRole(MANAGER_ROLE) {
if (pool == address(0)) revert InvalidPool();
if (supportedPools[pool] == isSupported) revert PoolNotSupported();
supportedPools[pool] = isSupported;
if (isSupported) {
emit PoolAdded(pool);
} else {
emit PoolRemoved(pool);

Impact

Attacker could register adress with malicious behaviour pretending that is an address of a pool, as providing a self-destructing contract. That will cause future errors if the attacker gains MANAGER_ROLE.

Tools Used

Recommendations

Instead of relying on onlyRole modifier you can add additional check.

import "@openzeppelin/contracts/utils/Address.sol";
function modifySupportedPool(address pool, bool isSupported) external onlyRole(MANAGER_ROLE) {
if (!Address.isContract(pool)) revert InvalidPool() ;
if (pool == address(0)) revert InvalidPool();
if (supportedPools[pool] == isSupported) revert PoolNotSupported();
supportedPools[pool] = isSupported;
if (isSupported) {
emit PoolAdded(pool);
} else {
emit PoolRemoved(pool);
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.