Skip to main content

CVE-2022-31198: CWE-682: Incorrect Calculation in OpenZeppelin openzeppelin-contracts

Medium
Published: Mon Aug 01 2022 (08/01/2022, 21:00:17 UTC)
Source: CVE
Vendor/Project: OpenZeppelin
Product: openzeppelin-contracts

Description

OpenZeppelin Contracts is a library for secure smart contract development. This issue concerns instances of Governor that use the module `GovernorVotesQuorumFraction`, a mechanism that determines quorum requirements as a percentage of the voting token's total supply. In affected instances, when a proposal is passed to lower the quorum requirements, past proposals may become executable if they had been defeated only due to lack of quorum, and the number of votes it received meets the new quorum requirement. Analysis of instances on chain found only one proposal that met this condition, and we are actively monitoring for new occurrences of this particular issue. This issue has been patched in v4.7.2. Users are advised to upgrade. Users unable to upgrade should consider avoiding lowering quorum requirements if a past proposal was defeated for lack of quorum.

AI-Powered Analysis

AILast updated: 06/23/2025, 00:51:55 UTC

Technical Analysis

CVE-2022-31198 is a medium-severity vulnerability identified in the OpenZeppelin Contracts library, specifically affecting versions from 4.3.0 up to but not including 4.7.2. OpenZeppelin Contracts is a widely used, open-source library designed to facilitate secure smart contract development on blockchain platforms, particularly Ethereum. The vulnerability resides in the GovernorVotesQuorumFraction module, which governs the quorum requirements for governance proposals as a percentage of the total voting token supply. The flaw arises when a proposal is passed that lowers the quorum requirement. In such cases, past proposals that were previously defeated solely due to insufficient quorum may retroactively become executable if the number of votes they received meets the newly lowered quorum threshold. This incorrect calculation stems from a logic error in how the quorum fraction is applied to past proposals, leading to unintended execution of proposals that should remain invalidated. The issue is classified under CWE-682 (Incorrect Calculation), indicating a fundamental logic error in the quorum computation. Although analysis of on-chain instances revealed only one proposal meeting this condition, the potential for exploitation exists, especially in decentralized autonomous organizations (DAOs) or other governance systems relying on OpenZeppelin's vulnerable versions. The vulnerability has been addressed and patched in OpenZeppelin Contracts version 4.7.2. Users unable to upgrade are advised to avoid lowering quorum requirements if any past proposals were defeated due to lack of quorum, to mitigate the risk of unintended proposal execution.

Potential Impact

For European organizations utilizing blockchain governance frameworks built on OpenZeppelin Contracts, this vulnerability could undermine the integrity and reliability of decentralized decision-making processes. Exploitation could allow previously rejected proposals to be enacted retroactively, potentially enabling malicious actors or insiders to bypass governance controls, enact unauthorized changes, or disrupt organizational operations. This threatens the integrity and availability of governance mechanisms, possibly leading to financial losses, reputational damage, and erosion of stakeholder trust. Given the increasing adoption of blockchain governance in sectors such as finance, supply chain, and public services within Europe, the impact could be significant where affected smart contracts are deployed. However, the lack of known exploits in the wild and the limited number of affected proposals observed suggest the immediate risk is moderate. Nonetheless, the potential for governance manipulation warrants proactive mitigation, especially for organizations managing critical assets or public interest projects.

Mitigation Recommendations

1. Immediate Upgrade: Organizations should prioritize upgrading OpenZeppelin Contracts to version 4.7.2 or later to incorporate the official patch addressing this vulnerability. 2. Governance Parameter Management: Until upgrading is feasible, avoid lowering quorum requirements if any past proposals were defeated due to insufficient quorum, as this can trigger the vulnerability. 3. Proposal Auditing: Conduct thorough audits of past proposals to identify any that were defeated solely due to quorum issues and assess their potential for retroactive execution. 4. Monitoring and Alerts: Implement on-chain monitoring tools to detect any unexpected execution of past proposals, enabling rapid response to suspicious governance activities. 5. Access Controls: Restrict permissions for submitting or passing proposals that alter quorum parameters to trusted governance participants to reduce risk of malicious quorum manipulation. 6. Incident Response Planning: Develop and test response plans for governance anomalies, including rollback mechanisms or emergency governance procedures to mitigate impact if exploitation occurs. 7. Community Coordination: Engage with the broader blockchain governance community to share threat intelligence and best practices related to this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-05-18T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9844c4522896dcbf3980

Added to database: 5/21/2025, 9:09:24 AM

Last enriched: 6/23/2025, 12:51:55 AM

Last updated: 8/5/2025, 7:19:19 AM

Views: 20

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats