Executive brief
OpenZeppelin Contracts provides smart contract libraries used by blockchain projects to implement governance mechanisms. An attacker can exploit a frontrunning vulnerability in the Governor proposal creation process to repeatedly block legitimate proposals from being submitted to a blockchain network. By observing and front-running proposal transactions, an attacker can hijack the proposer role and cancel proposals, disrupting the governance process and potentially preventing important organizational decisions from being made.
Technical details
The vulnerability is a frontrunning attack vector in the Governor contract's propose() function. An attacker monitoring the network can submit a conflicting proposal transaction with higher gas fees to execute before the legitimate proposal, becoming the proposer. Since only the proposer can cancel a proposal, the attacker can then immediately cancel it. By repeating this technique, an attacker can systematically prevent specific proposals from being created. The issue affects Governor v4.9.0 and GovernorCompatibilityBravo since v4.3.0. The attack requires network access to observe and submit transactions but no authentication. The fix, deployed in v4.9.1, introduces opt-in frontrunning protection via a suffix mechanism in the proposal description that restricts the proposer address, as documented in the _isValidDescriptionForProposer function.
Affected products
- OpenZeppelin @openzeppelin/contracts >=4.3.0, <4.9.1
- OpenZeppelin @openzeppelin/contracts-upgradeable >=4.3.0, <4.9.1
Timeline
- 2023-06-07: disclosed: Vulnerability disclosed; published via GitHub Advisory GHSA-5h3x-9wvq-w4m2
- 2023-06-07: patched: Fixed in v4.9.1 with opt-in frontrunning protection mechanism
References
- https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-5h3x-9wvq-w4m2
- https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/commit/66f390fa516b550838e2c2f65132b5bc2afe1ced
- https://github.com/OpenZeppelin/openzeppelin-contracts/commit/d9474327a492f9f310f31bc53f38dbea56ed9a57
- https://github.com/OpenZeppelin/openzeppelin-contracts
- https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v4.9.1