-
Notifications
You must be signed in to change notification settings - Fork 1
Update EmergencySystem.sol #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Owner Assignment in Constructor Allows Zero Address, Permanently Disabling Owner FunctionsDescription:TL;DR: In the DetailsThe vulnerability is located in the constructor of the constructor(address _owner) {
// bypasses 2-step ownership transfer
_transferOwnership(_owner);
}If ImpactDeploying the contract with a zero address as the owner completely disables the administrative control functions, including the emergency shutdown mechanism. This disables the ability to respond to potential threats or operational issues, potentially leading to an inability to protect the system during critical situations. Although the vulnerability does not directly allow theft or state corruption, the loss of controlled access severely impacts the system's resilience and manageability in emergency scenarios. Mitigation Steps:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrestricted Access to Emergency Shutdown Deactivation
Description:
TL;DR:
The
deactivateEmergencyShutdownfunction in theEmergencySystemcontract can be invoked by any external account due to the absence of an access control modifier, allowing unauthorized deactivation of the protocol's emergency shutdown.The
EmergencySystemcontract lacks proper access control on itsdeactivateEmergencyShutdownfunction, allowing any address to reset the emergency shutdown state. This flaw compromises the emergency safety mechanisms by enabling unauthorized actors to resume protocol operations during critical incidents.Details
In the
EmergencySystemcontract, thedeactivateEmergencyShutdownfunction is defined as:Unlike the
activateEmergencyShutdownfunction which is guarded by theonlyOwnermodifier, there is no similar restriction ondeactivateEmergencyShutdown. As a result, any external caller can set theemergencyShutdownActiveflag tofalseand generate anEmergencyShutdownDeactivatedevent, regardless of their authorization. This exposes the system to the risk of unauthorized protocol reactivation during emergency conditions, thereby undermining the intended isolation of sensitive protocol actions when the shutdown is active.Impact
An attacker or any external user can exploit this vulnerability to prematurely disable the emergency shutdown control, potentially triggering the resumption of critical protocol operations when the system should still remain halted. This could lead to unauthorized transactions, compromise user funds, and disrupt protocol invariants, making it a significant risk to the overall protocol safety.
Mitigation Steps:
Restrict access to the
deactivateEmergencyShutdownfunction by applying theonlyOwnermodifier or an equivalent access control mechanism.-Review and validate all functions managing critical state changes to ensure they enforce proper access restrictions.