LiveActive security incident?Get immediate response
CVE Record

CVE-2022-31170: OpenZeppelin Contracts's ERC165Checker may revert instead of returning false

OpenZeppelin Contracts is a library for smart contract development. Versions 4.0.0 until 4.7.1 are vulnerable to ERC165Checker reverting instead of returning `false`. `ERC165Checker.supportsInterface` is designed to always successfully return a boolean, and under no circumstance revert. However, an incorrect assumption about Solidity 0.8's `abi.decode` allows some cases to revert, given a target contract that doesn't implement EIP-165 as expected, specifically if it returns a value other than 0 or 1. The contracts that may be affected are those that use `ERC165Checker` to check for support for an interface and then handle the lack of support in a way other than reverting. The issue was patched in version 4.7.1.

HighCVSS 7.5Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

This issue affects projects using OpenZeppelin Contracts to check whether another smart contract supports an interface. A malformed or nonstandard target contract could make the check revert instead of returning false, breaking flows that expected graceful handling.

Executive priority

Prioritize review for blockchain systems where interface checks gate transfers, permissions, integrations, or user-facing workflows. The risk is not broad infrastructure compromise, but unexpected transaction failure or disrupted contract logic.

Technical view

In OpenZeppelin Contracts ERC165Checker, supportsInterface could revert when abi.decode processed a boolean-like return value other than 0 or 1. Affected versions are >=4.0.0 and <4.7.1. The issue is patched in 4.7.1.

Likely exposure

Exposure is limited to smart contracts or applications built with affected OpenZeppelin Contracts versions that call ERC165Checker.supportsInterface and handle unsupported interfaces without reverting.

Exploitation context

The provided sources do not show active exploitation, and CISA KEV status is false. Practical impact depends on whether untrusted or non-EIP-165-compliant contracts can be checked in business-critical flows.

Researcher notes

The key condition is a caller relying on ERC165Checker to return false for unsupported interfaces. Solidity 0.8 abi.decode can revert for invalid boolean encodings, contradicting that API expectation. Assess reachable call paths and downstream assumptions.

Mitigation direction

  • Inventory OpenZeppelin Contracts versions in affected repositories and deployed contract build artifacts.
  • Upgrade OpenZeppelin Contracts to version 4.7.1 or later where feasible.
  • Review logic that assumes supportsInterface always returns a boolean.
  • For immutable deployments, check vendor guidance and assess compensating controls around affected flows.
  • Add regression tests for nonstandard ERC165 responses and expected fallback behavior.

Validation and detection

  • Confirm package manifests or lockfiles do not use OpenZeppelin Contracts >=4.0.0 and <4.7.1.
  • Search contract code for ERC165Checker.supportsInterface usage.
  • Identify whether checked target contracts can be untrusted or non-EIP-165-compliant.
  • Verify unsupported-interface handling still behaves as intended after upgrade.
  • Document any deployed immutable contracts that cannot be patched directly.
Prepared
Confidence
high
Sources
4

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-20: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2022-31170 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.5 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
3Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.5CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N3.93.6Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.5High
CVSS 3.1 vector shape for CVE-2022-31170Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
OpenZeppelinopenzeppelin-contracts>= 4.0.0, < 4.7.1Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-20 · source CWE mapping

Improper Input Validation

Improper Input Validation represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.