What’s Vulnerable › Vulnerabilities
CVE-2022-35915: Unbounded gas consumption in @openzeppelin/contracts
- Severity: medium (CVSS 5.3 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.8% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2022-08-01 · updated 2026-06-17
- Weakness: CWE-400
Description
OpenZeppelin Contracts is a library for secure smart contract development. The target contract of an EIP-165 `supportsInterface` query can cause unbounded gas consumption by returning a lot of data, while it is generally assumed that this operation has a bounded cost. The issue has been fixed in v4.7.2. Users are advised to upgrade. There are no known workarounds for this issue.
Affected products
- openzeppelin-contracts: from 2.0.0 before 4.7.2 — fixed in 4.7.2
- OpenZeppelin Contracts Upgradeable: from 3.2.0 before 4.7.2 — fixed in 4.7.2
- Openzeppelin-Eth: from 2.0.0
- Openzeppelin-Solidity: from 2.0.0
How to fix
Upgrade to a fixed version: openzeppelin-contracts 4.7.2; OpenZeppelin Contracts Upgradeable 4.7.2. Check the vendor advisory for mitigations.
References
- https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3587
- https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-7grf-83vw-6f5x
- https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3587
- https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-7grf-83vw-6f5x
Get alerted when CVE-2022-35915 or the next vulnerability affects your stack