hats-finance / SafeStaking-by-HOPR-0x607386df18b663cf5ee9b879fbc1f32466ad5a85

HOPR is an open incentivized mixnet which enables privacy-preserving point-to-point data exchange. HOPR is similar to Tor but actually private, decentralized and economically sustainable.
https://hoprnet.org
GNU General Public License v3.0
0 stars 1 forks source link

Owner can renounce ownership of contract #49

Open hats-bug-reporter[bot] opened 11 months ago

hats-bug-reporter[bot] commented 11 months ago

Github username: -- Submission hash (on-chain): 0xcc2b91f819e304a653eefb36f340a1411688dbba8320e4b53543d6e7a16baa27 Severity: low

Description: Description\

Owner can renounce ownership of contract

Attack Scenario\

The contract HoprDummyProxyForNetworkRegistry,HoprTicketPriceOracle,HoprStakingProxyForNetworkRegistry inherits from Ownable but does not remove the ability for the owner to renounceOwnership. Renouncing before transfering the ownership would result in the cointract having no owner thereby rendering the contract completely unusable as there is only one external function, protected by onlyOwner

Attachments

  1. Proof of Concept (PoC) File

  2. Revised Code File (Optional)

It is recommended that the owner should not be able to renounce ownership without transfering the ownership first. The functionality can be disabled with the following code.

function renounceOwnership() public override onlyOwner {
    revert("Cannot renounce ownership");
}