Quick answers
- Is CVE-2022-35915 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2022-35915 being exploited in the wild.
- How severe is CVE-2022-35915?
- Low severity, with a CVSS score of 3.1, published 14 August 2022.
- Which products and versions are affected?
- @openzeppelin/contracts (npm) SEMVER:introduced=2.0.0,fixed=4.7.2; @openzeppelin/contracts-upgradeable (npm) SEMVER:introduced=3.2.0,fixed=4.7.2; openzeppelin-eth (npm) SEMVER:introduced=2.0.0,last_affected=2.2.0; openzeppelin-solidity (npm) SEMVER:introduced=2.0.0,last_affected=4.6.0; and 2 more.
- Is there a fix for CVE-2022-35915?
- Yes. @openzeppelin/contracts (npm): upgrade to 4.7.2 or later; @openzeppelin/contracts-upgradeable (npm): upgrade to 4.7.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2022-35915 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2022-35915?
- Check whether you run @openzeppelin/contracts (npm), @openzeppelin/contracts-upgradeable (npm), openzeppelin-eth (npm) 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.7.2 or later
npm install @openzeppelin/contracts@4.7.2 - @openzeppelin/contracts-upgradeable (npm): upgrade to 4.7.2 or later
npm install @openzeppelin/contracts-upgradeable@4.7.2
Technical details
The vulnerability exists in the ERC165Checker utility, which is used to query whether a target contract supports a specific EIP-165 interface via the supportsInterface function. An attacker controlling the target contract can craft a malicious implementation that returns large amounts of data, causing unbounded gas consumption during the query, violating the assumption that such checks have bounded cost. The attack is network-accessible and requires no authentication or user interaction; the attacker must control or manipulate the target contract being queried. This can lead to out-of-gas exceptions and denial of service. The issue has been patched in Contracts v4.7.2 and Contracts Upgradeable v4.7.2.
Affected products
- OpenZeppelin Contracts 2.0.0 to 4.7.1
- OpenZeppelin Contracts Upgradeable 3.2.0 to 4.7.1
- OpenZeppelin openzeppelin-eth 2.0.0 to 2.2.0
- OpenZeppelin openzeppelin-solidity 2.0.0 to 4.6.0
Identifiers
- CVE-2022-35915
- GHSA-7grf-83vw-6f5x
Timeline
- 2022-07-28: disclosed: Advisory published by OpenZeppelin
- 2022-08-14: patched: Fix released in v4.7.2 and Contracts Upgradeable v4.7.2