Skip to content
Business logic Audit finding Intermediate

Governance logic may enter a deadlock

The governance contract allows the security council to cancel any pending upgrade, including one that would remove it, and the owner is the only actor who can schedule upgrades. If either actor is compromised, the governance mechanism can be permanently blocked from upgrading.

erebus Follow with Audittens, AkshaySrivastav and 2 others

Originally disclosed on Code4rena

Submitted by erebus, also found by Audittens, AkshaySrivastav, twcctop, anon, and don’tonka

If any of the governance actors, either securityCouncil or owner, gets compromised, the whole governance logic will enter a deadlock (not a centralization risk as the Governance contract is exactly designed to prevent this kind of issues).

Proof of concept

The actions that each governance actor can do are the following:

  • securityCouncil

    • cancel
    • execute
    • executeInstant
  • owner

    • scheduleTransparent
    • scheduleShadow
    • cancel
    • execute

By extension, as the Governance contract can call itself through execute and executeInstant and the only one who can propose upgrades is owner, then he can do the following too:

  • updateSecurityCouncil
  • updateDelay

It becomes clear that:

  • If the owner gets compromised, then no one will ever make an upgrade again, as he is the only one who can submit one by calling scheduleTransparent or scheduleShadow.
  • If the securityCouncil gets compromised, then he can spam cancel to ban all upgrades made by the owner, even the ones trying to remove securityCouncil by calling updateSecurityCouncil, as the owner cannot call executeInstant and the proposals delay (although not enforced) is supposed to be non-zero.

So the governance logic will be broken.

Recommended Mitigation steps

After a talk with the sponsor, it seems in the future there will be some sort of escape hatch mechanism in which users will be able to withdraw their funds from zkSync Era to Ethereum or another L2 if any of the above happens. For the time being, the solutions we talked about were:

  1. Removing the cancel permission of the securityCouncil:
-   function cancel(bytes32 _id) external onlyOwnerOrSecurityCouncil {
+   function cancel(bytes32 _id) external onlyOwner {
        require(isOperationPending(_id), "Operation must be pending");
        delete timestamps[_id];
        emit OperationCancelled(_id);
    }
  1. Bounding by a minimum the possible delay (that way you prevent owner from virtually making instant upgrades):

Governance, function updateDelay

    function updateDelay(uint256 _newDelay) external onlySelf {
+       require(_newDelay >= MINIMUM_UPGRADE_DELAY, "whatever";)
        emit ChangeMinDelay(minDelay, _newDelay);
        minDelay = _newDelay;
    }

The constant MINIMUM_UPGRADE_DELAY is going to be a config one whose value is higher than the Solidity 1 day, as withdrawals from zkSync Era to Ethereum takes around 1 day. Users would have enough time to withdraw their funds if a malicious upgrade is ever scheduled.

miladpiri (zkSync) confirmed and commented:

If owner or security council are compromised, it breaks the full functionality of the governance mechanism. Indeed security council shouldn’t be able to break upgradability with delay. Medium can be fair.

Alex the Entreprenerd (judge) commented:

The Wardens have highlighted a governance deadlock scenario, which allows the security council to hold governance hostage.


The original report as published on Code4rena, by erebus. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The security council can cancel any pending operation, including one that would replace it, while the owner is the sole proposer, so a single compromised actor can halt all upgrades.

Impact

A compromised owner or security council could permanently block all governance upgrades, though the text notes a future escape hatch may let users withdraw funds.

What the attacker needed

Compromise of owner or security council

The fix

The report suggests removing the security council's cancel permission and enforcing a minimum upgrade delay so users have time to withdraw.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A governance contract lets a small group of trusted accounts make changes to a blockchain system. This report says that if one of those accounts is taken over by an attacker, they can stop all future changes, because one account can block every proposal and the other is the only one allowed to start one.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by erebus

View all

5 more disclosed reports, best first.

More from zkSync Era

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.