{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2022-31170","id":"CVE-2022-31170","title":"OpenZeppelin Contracts's ERC165Checker may revert instead of returning false","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 c","descriptionLong":"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.","published":"2022-07-21T14:00:18.000Z","updated":"2026-10-28T02:31:07.283936627Z","reserved":"2022-05-18T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"GitHub_M"},"metrics":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"GitHub_M"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"github.com"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"NVD"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"OSV"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"GitHub"}],"rating":"high","products":["openzeppelin-contracts"],"affectedProducts":[{"vendor":"OpenZeppelin","product":"openzeppelin-contracts","defaultStatus":null,"versions":[{"status":"affected","version":">= 4.0.0, < 4.7.1"}],"platforms":[]}],"packages":[{"ecosystem":"npm","name":"@openzeppelin/contracts","purl":"pkg:npm/%40openzeppelin/contracts","ranges":[">=4.0.0 <4.7.1"],"fixed":["4.7.1"],"advisory":"GHSA-qh9x-gcfh-pcrw"},{"ecosystem":"npm","name":"@openzeppelin/contracts-upgradeable","purl":"pkg:npm/%40openzeppelin/contracts-upgradeable","ranges":[">=4.0.0 <4.7.1"],"fixed":["4.7.1"],"advisory":"GHSA-qh9x-gcfh-pcrw"}],"cwes":["CWE-20","CWE-252"],"aliases":["GHSA-qh9x-gcfh-pcrw"],"references":[{"url":"https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3552","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-qh9x-gcfh-pcrw","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31170.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31170","tags":["advisory"]},{"url":"https://github.com/OpenZeppelin/openzeppelin-contracts","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial"},"epss":0.00788,"epssPercentile":0.56902,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2022-31170","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31170","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2022-31170","ok":true,"note":"2 packages"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-qh9x-gcfh-pcrw","ok":true,"note":"GHSA-qh9x-gcfh-pcrw"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2022-31170","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}