Quick answers
- Is CVE-2023-30542 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2023-30542 being exploited in the wild.
- How severe is CVE-2023-30542?
- Low severity, with a CVSS score of 3.1, published 20 April 2023.
- Which products and versions are affected?
- @openzeppelin/contracts (npm) SEMVER:introduced=4.3.0,fixed=4.8.3; @openzeppelin/contracts-upgradeable (npm) SEMVER:introduced=4.3.0,fixed=4.8.3; OpenZeppelin Contracts 4.3.0 through 4.8.2; OpenZeppelin Contracts Upgradeable 4.3.0 through 4.8.2.
- Is there a fix for CVE-2023-30542?
- Yes. @openzeppelin/contracts (npm): upgrade to 4.8.3 or later; @openzeppelin/contracts-upgradeable (npm): upgrade to 4.8.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2023-30542 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2023-30542?
- 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.8.3 or later
npm install @openzeppelin/contracts@4.8.3 - @openzeppelin/contracts-upgradeable (npm): upgrade to 4.8.3 or later
npm install @openzeppelin/contracts-upgradeable@4.8.3
Technical details
The vulnerability is an input validation flaw (CWE-20) in GovernorCompatibilityBravo's propose() function, which fails to validate that the signatures and calldatas arrays have equal length. When signatures is shorter than calldatas, the excess calldata elements are silently trimmed during execution. While the ProposalCreated event correctly reflects the truncated execution, getActions() returns the original, full calldata array, creating an information disclosure and creating discrepancy between governance approval and actual execution. The vulnerability affects versions 4.3.0 through 4.8.2 and is fixed in v4.8.3. The attack requires authorization to create proposals (typically token voting) but no user interaction or network-level privileges.
Affected products
- OpenZeppelin Contracts 4.3.0 through 4.8.2
- OpenZeppelin Contracts Upgradeable 4.3.0 through 4.8.2
Identifiers
- CVE-2023-30542
- GHSA-93hq-5wgc-jc82
Timeline
- 2023-04-13: disclosed: Vulnerability published in GitHub advisory
- 2023-04-20: patched: v4.8.3 released with patch