Skip to content

Latest commit

 

History

History
42 lines (23 loc) · 1.56 KB

054.md

File metadata and controls

42 lines (23 loc) · 1.56 KB

Broad Jetblack Alligator

Medium

Immutable Role Assignment in Upgradeable Contracts in MasterUtils.sol

Summary

The fixed role assignment at contract initialization poses a security risk, as compromised admin accounts cannot be revoked or replaced, potentially allowing unauthorized control over essential contract functions.

https://github.com/sherlock-audit/2024-10-axion/blob/d75df3636ea28dd627d548d5d473c5d5477b0dc6/solidly-utils/contracts/MasterUtils.sol#L73C1-L76C44

Root Cause

In MasterUtils.sol, the initialize function sets up roles using _setupRole without providing mechanisms to change or revoke these roles.

Internal pre-conditions

  1. The contract needs to be deployed and initialized.
  2. Roles (DEFAULT_ADMIN_ROLE, OPERATOR_ROLE, SETTER_ROLE, WITHDRAWER_ROLE) are assigned to specific addresses during initialization.

External pre-conditions

A role address get hacked.

Attack Path

  1. An attacker gains control of a critical address (e.g., OPERATOR_ROLE).
  2. They can perform unauthorized actions, like altering essential parameters.
  3. The protocol owners are unable to revoke the compromised role or assign it to a secure address.

Impact

The protocol risks losing control over essential functions, which may result in financial losses, unauthorized alterations to contract parameters, or complete contract failure, impacting all users and stakeholders.

PoC

No response

Mitigation

Implement functions to revoke and reassign roles, accessible only by the DEFAULT_ADMIN_ROLE or the WITHDRAWER_ROLE because its a multisig