Missing zero address check could lead to an executeEmergency() callable by anyone #17
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
valid
Lines of code
https://github.com/code-423n4/2022-06-nested/blob/main/contracts/governance/TimelockControllerEmergency.sol#L295
Vulnerability details
Impact
The
executeEmergency()
is only callable by theEMERGENCY_ROLE
role. However if at constract construction,emergency
address was is zero, thenEMERGENCY_ROLE
role would be enabled for everyone leading to anyone executing a transaction without schedulingProof of Concept
emergency
argument in TimelockControllerEmergency.constructor() as address(0) hoping to change it anytime.@openzeppelin/contracts/access/AccessControl.sol
, this would enable theEMERGENCY_ROLE
role open to everyone.executeEmergency()
without restriction and can execute a transaction without any delay.Tools Used
Manual review
Recommended Mitigation Steps
Add a require check for zero address in the constructor function.
The text was updated successfully, but these errors were encountered: