CVE-2022-31170
published high CVSS 3.1 · 7.5OpenZeppelin Contracts's ERC165Checker may revert instead of returning false
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| OpenZeppelin | — | openzeppelin-contracts>= 4.0.0, < 4.7.1 | Affected | Not stated | GitHub_M |
Description
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.5 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| OpenZeppelin | openzeppelin-contracts | >= 4.0.0, < 4.7.1 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-20 CWE-20: Improper Input Validation
References
2Provider assertions
3GitHub_M · cna
OpenZeppelin Contracts's ERC165Checker may revert instead of returning false
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- ca7da4e882004d23005cfbe9a61761236a476266eac08d9c70d113763d50324b
- Ingested
- 23 Sep 2026, 08:00:25 UTC
- Source record
- Official CVE record