{"id":"CVE-2022-31170","published":"2022-07-21T14:00:18Z","modified":"2025-04-23T17:57:25Z","title":"OpenZeppelin Contracts's ERC165Checker may revert instead of returning false","vendor":"OpenZeppelin","product":"openzeppelin-contracts","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00823,"percentile":0.54419,"provenance":"source"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3552","tags":["x_refsource_MISC"]},{"url":"https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-qh9x-gcfh-pcrw","tags":["x_refsource_CONFIRM"]}],"priority":{"score":16.1,"factors":[{"name":"EPSS percentile","points":10.88},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"openzeppelin","affectedVersions":[{"vendor":"OpenZeppelin","product":"openzeppelin-contracts","versions":[">= 4.0.0, < 4.7.1"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2025-04-23T15:53:10.305026Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"@openzeppelin/contracts","vulnerableRanges":[">=4.0.0, <4.7.1"],"patched":["4.7.1"],"from":["GHSA-qh9x-gcfh-pcrw"],"provenance":"source"},{"ecosystem":"npm","package":"@openzeppelin/contracts-upgradeable","vulnerableRanges":[">=4.0.0, <4.7.1"],"patched":["4.7.1"],"from":["GHSA-qh9x-gcfh-pcrw"],"provenance":"source"}],"summary":{"text":"The OpenZeppelin Contracts library's ERC165Checker component, in versions 4.0.0 through 4.7.1, can revert instead of returning false when it calls supportsInterface on a target contract that doesn't implement EIP-165 as expected, specifically one that returns a value other than 0 or 1. An attacker who can get a contract to call that target through network access alone, with no authentication or user interaction, can cause the check to revert, and this matters for contracts that use ERC165Checker to test interface support and then handle the unsupported case without reverting themselves.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:03:20Z"},"euvd":{"id":"EUVD-2022-6398","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2021-41264","published":"2021-11-12","fixed":"4.3.2","kev":false},{"cve":"CVE-2021-46320","published":"2022-02-04","fixed":"4.4.1","kev":false,"link":{"from":"CVE-2021-46320","to":"CVE-2022-31170","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:@openzeppelin/contracts","fromFixed":"4.4.1","toFixed":"4.7.1","daysApart":167}]}},{"cve":"CVE-2022-39384","published":"2022-11-04","fixed":"4.4.1","kev":false},{"cve":"CVE-2022-31170","published":"2022-07-21","fixed":"4.7.1","kev":false},{"cve":"CVE-2022-31172","published":"2022-07-21","fixed":"4.7.1","kev":false},{"cve":"CVE-2022-31198","published":"2022-08-01","fixed":"4.7.2","kev":false},{"cve":"CVE-2022-35915","published":"2022-08-01","fixed":"4.7.2","kev":false}],"package":"npm:@openzeppelin/contracts"}}