Mend.io Vulnerability Database
The largest open source vulnerability database
What is a Vulnerability ID?
New vulnerability? Tell us about it!
CVE-2022-31170
July 21, 2022
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.
Affected Packages
@openzeppelin/contracts-upgradeable (NPM):
Affected version(s) >=4.0.0 <4.7.1
Fix Suggestion:
Update to version 4.7.1
@openzeppelin/contracts (NPM):
Affected version(s) >=4.0.0 <4.7.1
Fix Suggestion:
Update to version 4.7.1
Additional Notes
The description of this vulnerability differs from MITRE.
Do you need more information?
Contact Us
CVSS v4
Base Score:
8.7
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
NONE
Vulnerable System Integrity
HIGH
Vulnerable System Availability
NONE
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
7.5
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
HIGH
Availability
NONE
Weakness Type (CWE)
Unchecked Return Value
Improper Input Validation
EPSS
Base Score:
0.31