{"cve":"CVE-2022-31170","nvd":{"published":"2022-07-22T04:15:14.547","modified":"2026-06-17T04:44:57.307","status":"Modified","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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5},"cwes":["CWE-252","CWE-20"],"references":["https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3552","https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-qh9x-gcfh-pcrw","https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3552","https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-qh9x-gcfh-pcrw"],"products":["openzeppelin:contracts"],"source":"nvd","synced_at":"2026-10-19T21:33:44.859608815+00:00"},"epss":{"cve":"CVE-2022-31170","score":0.00788,"percentile":0.56193,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-qh9x-gcfh-pcrw","url":"https://osv.dev/vulnerability/GHSA-qh9x-gcfh-pcrw","summary":"OpenZeppelin Contracts's ERC165Checker may revert instead of returning false","modified":"2023-11-08T04:09:28.586055Z","packages":[{"ecosystem":"npm","name":"@openzeppelin/contracts","purl":"pkg:npm/%40openzeppelin/contracts","ranges":[">=4.0.0 <4.7.1"],"fixed":["4.7.1"]},{"ecosystem":"npm","name":"@openzeppelin/contracts-upgradeable","purl":"pkg:npm/%40openzeppelin/contracts-upgradeable","ranges":[">=4.0.0 <4.7.1"],"fixed":["4.7.1"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}