Security mailing lists by PureSourceCode

CVE-2022-31170

HIGH 7.5CVSS 3.1

OpenZeppelin Contracts's ERC165Checker may revert instead of returning false

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
22 Jul 2022
Last modified
17 Jun 2026
Assigned by
security-advisories@github.com
NVD status
Modified
Weakness
CWE-20CWE-252
Also known as
GHSA-qh9x-gcfh-pcrw
Sources
NVDJSONOSV GHSA-qh9x-gcfh-pcrwJSON

Scores

SourceScored byVersionScoreVector / decision
NVD security-advisories@github.com (Secondary) CVSS 3.1 HIGH 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD nvd@nist.gov (Primary) CVSS 3.1 HIGH 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
OSV GitHub CVSS 3.1 HIGH 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD openzeppelin contracts
cpe:2.3:a:openzeppelin:contracts:*:*:*:*:*:node.js:*:*
>= 4.0.0, < 4.7.1 4.7.1
OSV npm @openzeppelin/contracts >= 4.0.0, < 4.7.1 4.7.1
OSV npm @openzeppelin/contracts-upgradeable >= 4.0.0, < 4.7.1 4.7.1

References

History

  • 25 Nov 2026 20:34 UTC · NVD: first stored (published 22 Jul 2022)
  • 25 Nov 2026 20:11 UTC · OSV: first stored (published 21 Jul 2022)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.