Quick answers
- Is This vulnerability exploited in the wild?
- No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
- How severe is This vulnerability?
- Informational severity, published 13 January 2022.
- Which products and versions are affected?
- @openzeppelin/contracts (npm) SEMVER:introduced=4.3.0,fixed=4.4.2; @openzeppelin/contracts-upgradeable (npm) SEMVER:introduced=4.3.0,fixed=4.4.2; OpenZeppelin Contracts 4.3.0 through 4.4.1; OpenZeppelin Contracts Upgradeable 4.3.0 through 4.4.1.
- Is there a fix for This vulnerability?
- Yes. @openzeppelin/contracts (npm): upgrade to 4.4.2 or later; @openzeppelin/contracts-upgradeable (npm): upgrade to 4.4.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is This vulnerability attacked?
- It is attacked with local access, in a software library.
- Am I affected?
- Check whether you run @openzeppelin/contracts (npm), @openzeppelin/contracts-upgradeable (npm), OpenZeppelin Contracts or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- @openzeppelin/contracts (npm): upgrade to 4.4.2 or later
npm install @openzeppelin/contracts@4.4.2 - @openzeppelin/contracts-upgradeable (npm): upgrade to 4.4.2 or later
npm install @openzeppelin/contracts-upgradeable@4.4.2
Technical details
The vulnerability exists in the GovernorCompatibilityBravo contract's ABI encoding logic when proposals are created with explicit function signatures (e.g., "foo(uint256)") rather than pre-encoded function selectors. When a proposal is created using the signatures parameter, the contract incorrectly encodes the provided calldata, leading to function calls with incorrect arguments. The attack vector requires local control of proposal creation; no network or authentication bypass is needed. An attacker controlling proposal submission can craft proposals that execute unintended logic. This issue affects versions 4.3.0 through 4.4.1; it was patched in v4.4.2. Proposal creation through the Tally platform or OpenZeppelin Defender is not affected.
Affected products
- OpenZeppelin Contracts 4.3.0 through 4.4.1
- OpenZeppelin Contracts Upgradeable 4.3.0 through 4.4.1
Timeline
- 2022-01-11: disclosed: Advisory published
- 2022-01-13: patched: Version 4.4.2 released with fix