GHSA-xrc4-737v-9q75 CVE-2022-31198
OpenZeppelin Contracts's GovernorVotesQuorumFraction updates to quorum may affect past defeated proposals
- Severity
- 7.5 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 0.79%
- Chance of exploitation in the next 30 days. Higher than 56.19% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-682 Incorrect Calculation
- Fix
- Available
- 2 packages have a fixed version
Description
Impact
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 requirement, 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.
Patches
This issue has been patched in v4.7.2.
Workarounds
Avoid lowering quorum requirements if a past proposal was defeated for lack of quorum.
References
https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3561
For more information
If you have any questions or comments about this advisory, or need assistance deploying the fix, email us at security@openzeppelin.com.
Affected versions
npm
| Package | Vulnerable | Fixed in |
|---|---|---|
| @openzeppelin/contracts | >= 4.3.0, < 4.7.2 |
4.7.2 |
| @openzeppelin/contracts-upgradeable | >= 4.3.0, < 4.7.2 |
4.7.2 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
@openzeppelin/contracts npm → 4.7.2
- npm
npm install @openzeppelin/contracts@4.7.2- yarn
yarn add @openzeppelin/contracts@4.7.2- pnpm
pnpm add @openzeppelin/contracts@4.7.2
@openzeppelin/contracts-upgradeable npm → 4.7.2
- npm
npm install @openzeppelin/contracts-upgradeable@4.7.2- yarn
yarn add @openzeppelin/contracts-upgradeable@4.7.2- pnpm
pnpm add @openzeppelin/contracts-upgradeable@4.7.2
Severity breakdown
CVSS 3.1 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Weakness
CWE-682: Incorrect Calculation
The product performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management.
How to prevent it
- Implementation: Understand your programming language's underlying representation and how it interacts with numeric calculation. Pay close attention to byte size discrepancies, precision, signed/unsigned distinctions, truncation, conversion and casting between types, "not-a-number" calculations, and how your language handles numbers that are too large or too small for its underlying representation.
- Implementation: Perform input validation on any numeric input by ensuring that it is within the expected range. Enforce that the input meets both the minimum and maximum requirements for the expected range.
- Implementation: Use the appropriate type for the desired action. For example, in C/C++, only use unsigned types for values that could never be negative, such as height, width, or other numbers related to quantity.
- Architecture and Design: Use languages, libraries, or frameworks that make it easier to handle numbers without unexpected consequences. Examples include safe integer handling packages such as SafeInt (C++) or IntegerLib (C or C++).
- Architecture and Design: Use languages, libraries, or frameworks that make it easier to handle numbers without unexpected consequences. Examples include safe integer handling packages such as SafeInt (C++) or IntegerLib (C or C++).
- Implementation: Examine compiler warnings closely and eliminate problems with potential security implications, such as signed / unsigned mismatch in memory operations, or use of uninitialized variables. Even if the weakness is rarely exploitable, a single failure may lead to the compromise of the entire system.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-9rcw-c2f9-2j55 OpenZeppelin Contracts Bytes's lastIndexOf function with position argument performs out-of-bound memory access on empty buffers | Medium | Also affects @openzeppelin/contracts |
| GHSA-9vx6-7xxf-x967 OpenZeppelin Contracts base64 encoding may read from potentially dirty memory | High | Also affects @openzeppelin/contracts |
| GHSA-699g-q6qh-q4v8 OpenZeppelin Contracts and Contracts Upgradeable duplicated execution of subcalls in v4.9.4 | High | Also affects @openzeppelin/contracts |
| GHSA-g4vp-m682-qqmp OpenZeppelin Contracts vulnerable to Improper Escaping of Output | Medium | Also affects @openzeppelin/contracts |
| GHSA-wprv-93r4-jj2p OpenZeppelin Contracts using MerkleProof multiproofs may allow proving arbitrary leaves for specific trees | Medium | Also affects @openzeppelin/contracts |
| GHSA-5h3x-9wvq-w4m2 OpenZeppelin Contracts's governor proposal creation may be blocked by frontrunning | Medium | Also affects @openzeppelin/contracts |
| GHSA-mx2q-35m2-x2rh OpenZeppelin Contracts TransparentUpgradeableProxy clashing selector calls may not be delegated | Medium | Also affects @openzeppelin/contracts |
| GHSA-93hq-5wgc-jc82 GovernorCompatibilityBravo may trim proposal calldata | High | Also affects @openzeppelin/contracts |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor