Skip to main content

CVE-2022-35915: CWE-400: Uncontrolled Resource Consumption in OpenZeppelin openzeppelin-contracts

Medium
Published: Mon Aug 01 2022 (08/01/2022, 21:05:11 UTC)
Source: CVE
Vendor/Project: OpenZeppelin
Product: openzeppelin-contracts

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.

AI-Powered Analysis

AILast updated: 06/23/2025, 00:36:55 UTC

Technical Analysis

CVE-2022-35915 is a medium-severity vulnerability identified in the OpenZeppelin Contracts library, a widely used framework for developing secure smart contracts on blockchain platforms such as Ethereum. The vulnerability arises from an uncontrolled resource consumption issue (CWE-400) related to the implementation of the EIP-165 standard's supportsInterface function. This function is designed to allow smart contracts to declare which interfaces they implement, enabling interoperability and introspection. However, in affected versions of OpenZeppelin Contracts (>=2.0.0 and <4.7.2), the supportsInterface query can be exploited to cause unbounded gas consumption. Specifically, the target contract can return an excessive amount of data in response to the supportsInterface call, leading to unexpectedly high gas usage. This behavior violates the general assumption that supportsInterface queries have a bounded and predictable gas cost. The excessive gas consumption can result in denial of service conditions by exhausting the gas limit of transactions or blocks, potentially disrupting contract interactions or causing transaction failures. The issue was addressed and fixed in version 4.7.2 of the OpenZeppelin Contracts library. No known workarounds exist, so upgrading to the patched version is the primary remediation. There are no known exploits in the wild at this time, but the vulnerability poses a risk to any smart contract relying on the affected versions of the library, especially those exposed to untrusted inputs or external calls invoking supportsInterface. Given the critical role of OpenZeppelin Contracts in the Ethereum ecosystem and other EVM-compatible blockchains, this vulnerability could impact a broad range of decentralized applications (dApps), DeFi protocols, and enterprise blockchain solutions that have not updated to the fixed version.

Potential Impact

For European organizations leveraging blockchain technology, particularly those developing or deploying smart contracts using OpenZeppelin Contracts, this vulnerability could lead to significant operational disruptions. Uncontrolled gas consumption can cause transaction failures, increased operational costs due to higher gas fees, and potential denial of service scenarios where legitimate contract interactions are blocked or delayed. This can undermine trust in blockchain-based services, affect financial transactions, and disrupt automated processes relying on smart contracts. Organizations in sectors such as finance, supply chain, healthcare, and public services that are adopting blockchain solutions may experience degraded service availability or increased costs. Additionally, the inability to bound gas consumption could be exploited by malicious actors to launch denial of service attacks against smart contracts, impacting the integrity and availability of critical blockchain applications. While no exploits are currently known, the widespread use of OpenZeppelin Contracts in the European blockchain development community means that unpatched deployments remain at risk.

Mitigation Recommendations

The primary mitigation is to upgrade all affected smart contracts to use OpenZeppelin Contracts version 4.7.2 or later, where the vulnerability has been fixed. Organizations should audit their smart contract codebases and dependencies to identify usage of vulnerable versions. For contracts already deployed on-chain, consider redeploying updated contracts with the patched library and migrating state where feasible. Implement rigorous testing and gas usage monitoring to detect abnormal gas consumption patterns during contract interactions. Where upgrading is not immediately possible, limit or restrict external calls that invoke supportsInterface queries, particularly from untrusted sources, to reduce exposure. Employ blockchain transaction monitoring tools to identify and alert on transactions exhibiting unusually high gas consumption related to supportsInterface calls. Engage with blockchain security auditors to review smart contract implementations for similar resource consumption issues. Finally, maintain awareness of updates from OpenZeppelin and the broader blockchain security community to promptly apply patches and best practices.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-07-15T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9844c4522896dcbf3a11

Added to database: 5/21/2025, 9:09:24 AM

Last enriched: 6/23/2025, 12:36:55 AM

Last updated: 8/14/2025, 7:47:16 PM

Views: 19

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats