Closed c4-bot-1 closed 7 months ago
saxenism (sponsor) disputed
We don't think this is an issue. To bypass delay, one needs to wait for the delay so all good.
The Warden describes that the delay configuration of the Governance
module is not sanitized.
As the Sponsor describes, an update of the delay would still have to honor the originally configured delay thereby offering adequate time for governance members to react to a malicious change. I do not consider sanitization of the delay a valid medium-risk vulnerability, and such a concern is better submitted in a QA report.
alex-ppg marked the issue as unsatisfactory: Overinflated severity
Lines of code
https://github.com/code-423n4/2024-03-zksync/blob/4f0ba34f34a864c354c7e8c47643ed8f4a250e13/code/contracts/ethereum/contracts/governance/Governance.sol#L249-L252
Vulnerability details
Impact
No enforcement of a minimum delay in the
updateDelay
function could undermine the entire governance mechanism of the contract and lead to the following consequences:execute
andexecuteInstant
functions to perform unauthorized actions, such as draining funds, modifying contract state, or executing arbitrary code.Proof of Concept
https://github.com/code-423n4/2024-03-zksync/blob/4f0ba34f34a864c354c7e8c47643ed8f4a250e13/code/contracts/ethereum/contracts/governance/Governance.sol#L249-L252
The
updateDelay
function in the contract lacks enforcement of a minimum delay value when updating theminDelay
parameter. This could allow an attacker who gains control of the contract by hook or crook to set theminDelay
to zero or an extremely low value, effectively bypassing the intended timelock mechanism for governance operations.With a minimal or no delay, an attacker could then schedule and execute malicious operations almost immediately, exploiting functions like
scheduleTransparent
,scheduleShadow
,execute
, andexecuteInstant
.Tools Used
God & Manual Review
Recommended Mitigation Steps
I'd recommend enforcing a reasonable minimum delay in the
updateDelay
function. This can be achieved by adding a check to ensure that the new delay value is greater than or equal to a predefined minimum delay constant.Alternatively, the contract could enforce a hard-coded minimum delay that cannot be changed, ensuring a reasonable timelock is always in place.
This will ensure that a minimum delay is always enforced, protecting the intended governance process and mitigating the risk of immediate execution of malicious operations.
Assessed type
Access Control