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

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.81%, higher than 57% of CVEs (2026-12-01)
- Published: 2022-07-21T14:00:18.000Z
- Modified: 2026-06-17T04:44:57.307Z
- Also known as: GHSA-qh9x-gcfh-pcrw
- Weaknesses: CWE-20, CWE-252
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: 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.

(As written by CVE List.)

## Affected

- OpenZeppelin openzeppelin-contracts: >= 4.0.0, < 4.7.1
- @openzeppelin/contracts (npm): from 4.0.0 before 4.7.1
- @openzeppelin/contracts-upgradeable (npm): from 4.0.0 before 4.7.1
- openzeppelin contracts: from 4.0.0 before 4.7.1

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`

## References

- <https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3552> (patch, third-party-advisory, web)
- <https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-qh9x-gcfh-pcrw> (third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31170> (advisory)
- <https://github.com/OpenZeppelin/openzeppelin-contracts> (package)

## Sources

- CVE List: [CVE-2022-31170](https://www.cve.org/CVERecord?id=CVE-2022-31170), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-qh9x-gcfh-pcrw](https://github.com/advisories/GHSA-qh9x-gcfh-pcrw), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-31170](https://nvd.nist.gov/vuln/detail/CVE-2022-31170), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-31170 · Whole record: https://cve.day/CVE-2022-31170.json · Rebuilt by cve.day 2026-11-25T22:58:13.159Z
