This repository has been archived by the owner on Mar 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
thekmj - emergency_shutdown
role is not enough for emergency shutdown.
#1
Labels
Disagree With Severity
The sponsor disputed the severity of this issue
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
Comments
github-actions
bot
added
Medium
A valid Medium severity issue
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
labels
Sep 1, 2023
1 comment(s) were left on this issue during the judging contest. 0xyPhilic commented:
|
ohmzeus
added a commit
to ohmzeus/Cooler
that referenced
this issue
Sep 5, 2023
Summary: emergency_shutdown role is not enough for emergency shutdown. Issue Link: sherlock-audit/2023-08-cooler-judging#1 Fix Description: Refactor defund() into a permissioned external function and an unpermissioned _defund() internal function. emergencyShutdown() interacts with internal function instead of external function to avoid permissioning issue.
0xrusowsky
pushed a commit
to ohmzeus/Cooler
that referenced
this issue
Sep 7, 2023
* Fix Issue 01 Summary: emergency_shutdown role is not enough for emergency shutdown. Issue Link: sherlock-audit/2023-08-cooler-judging#1 Fix Description: Refactor defund() into a permissioned external function and an unpermissioned _defund() internal function. emergencyShutdown() interacts with internal function instead of external function to avoid permissioning issue.
0xrusowsky
added
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Disagree With Severity
The sponsor disputed the severity of this issue
Will Fix
The sponsor confirmed this issue will be fixed
labels
Sep 9, 2023
fair point, but it still should be low as a user can have several roles |
I have to disagree, a user can indeed have several roles, but that can not be ensured/ if there are two separate roles they should be considered separate. |
sherlock-admin
changed the title
Breezy Myrtle Anteater -
thekmj - Sep 12, 2023
emergency_shutdown
role is not enough for emergency shutdown.emergency_shutdown
role is not enough for emergency shutdown.
Fix: ohmzeus/Cooler#50 |
Fix confirmed. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Disagree With Severity
The sponsor disputed the severity of this issue
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
thekmj
high
emergency_shutdown
role is not enough for emergency shutdown.Summary
There are two protocol roles,
emergency_shutdown
andcooler_overseer
. Theemergency_shutdown
should have the ability to shutdown the Clearinghouse.However, in the current contract,
emergency_shutdown
role does not have said ability. An address will need bothemergency_shutdown
andcooler_overseer
to perform said action.We have also confirmed with the protocol team that the two roles will be held by two different multisigs, with the shutdown multisig having a lower threshold and more holders. Thereby governance will not be able to act as quickly to emergencies than expected.
Vulnerability Detail
Let's examine the function
emergencyShutdown()
:This has the modifier
onlyRole("emergency_shutdown")
. However, this also calls functiondefund()
, which has the modifieronlyRole("cooler_overseer")
Therefore, the role
emergency_shutdown
will not have the ability to shutdown the protocol, unless it also has the overseer role.Proof of concept
To get a coded PoC, make the following modifications to the test case:
Clearinghouse.t.sol
, comment out line 125 (so thatoverseer
only hasemergency_shutdown
role)https://github.com/sherlock-audit/2023-08-cooler/blob/main/Cooler/src/test/Clearinghouse.t.sol#L125
test_emergencyShutdown()
):forge test --match-test test_emergencyShutdown
The test will fail with the
ROLES_RequireRole()
error.Impact
emergency_shutdown
role cannot emergency shutdown the protocolCode Snippet
https://github.com/sherlock-audit/2023-08-cooler/blob/main/Cooler/src/Clearinghouse.sol#L339
https://github.com/sherlock-audit/2023-08-cooler/blob/main/Cooler/src/Clearinghouse.sol#L360-L372
Tool used
Manual Review, Foundry/Forge
Recommendation
There are two ways to mitigate this issue:
The text was updated successfully, but these errors were encountered: