Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 2.1 KB

034.md

File metadata and controls

40 lines (32 loc) · 2.1 KB

Hidden Bronze Piranha

Medium

Admin will cause operational inconsistencies for external dependencies

Summary: The lack of synchronization in Borrowing.sol::setTreasury will cause operational inconsistencies for external dependencies as the admin will change the treasury address without updating references to the previous address.

Root Cause: In Borrowing.sol:173, the function setTreasury fails to ensure that external dependencies relying on the old treasury address are updated, leading to operational inconsistencies.

Impact: The protocol suffers from operational inconsistencies, including failed interactions with external protocols and potential fund mismanagement. This could lead to significant disruptions and loss of trust in the system.

Attack Path:

  1. The admin calls Borrowing.sol::setTreasury to change the treasury address.
  2. External systems continue using the outdated treasury address, causing desynchronized states.
  3. Operations relying on the old treasury, such as fund transfers or permissions, fail or behave incorrectly.

Mitigation:

  1. Validate redundancy:
    if (_treasury == treasuryAddress) revert Treasury_SameAddress();
  2. Emit events to notify dependencies:
    event TreasuryUpdated(address indexed oldTreasury, address indexed newTreasury);
  3. Synchronize dependencies:
    function notifyDependencies() internal {
        externalDependency.updateTreasury(treasuryAddress);
    }

References:

  1. [M-3: Controller doesn't send treasury funds to the vault's treasury address](https://solodit.cyfrin.io/issues/m-3-controller-doesnt-send-treasury-funds-to-the-vaults-treasury-address-sherlock-none-y2k-git)
  2. [M-7: changeTreasury() Lack of check and remove old](https://solodit.cyfrin.io/issues/m-7-changetreasury-lack-of-check-and-remove-old-sherlock-none-y2k-git)