PT-2022-20584 · Openzeppelin · Openzeppelin Contracts

Frangio

·

Published

2022-07-21

·

Updated

2022-08-01

·

CVE-2022-31170

CVSS v3.1

7.5

High

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Name of the Vulnerable Software and Affected Versions OpenZeppelin Contracts versions 4.0.0 through 4.7.1
Description The issue concerns the ERC165Checker in OpenZeppelin Contracts, which may revert instead of returning false under certain conditions. Specifically, this occurs when a target contract does not implement EIP-165 as expected and 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.
Recommendations For versions 4.0.0 through 4.7.1, update to version 4.7.1 to resolve the issue. As a temporary workaround, consider modifying the contract to handle the lack of support in a way that does not rely on the return value of ERC165Checker.supportsInterface. Restrict access to the ERC165Checker function to minimize the risk of exploitation until the issue is resolved.

Exploit

Fix

Unchecked Return Value

RCE

Weakness Enumeration

Related Identifiers

CVE-2022-31170
GHSA-QH9X-GCFH-PCRW

Affected Products

Openzeppelin Contracts