CVE-2022-31172
JSON

7.5high

OpenZeppelin Contracts's SignatureChecker may revert on invalid EIP-1271 signers

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.52% (higher than 45% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4g63-c64m-25w9

Description

OpenZeppelin Contracts is a library for smart contract development. Versions 4.1.0 until 4.7.1 are vulnerable to the SignatureChecker reverting. `SignatureChecker.isValidSignatureNow` is not expected to 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-1271 as expected. The contracts that may be affected are those that use `SignatureChecker` to check the validity of a signature and handle invalid signatures in a way other than reverting. The issue was patched in version 4.7.1.

Affected

Product or packageVersionsReported by
OpenZeppelin openzeppelin-contracts>= 4.1.0, < 4.7.1CVE List
@openzeppelin/contracts (npm)from 4.1.0 before 4.7.1GitHub Advisory Database
@openzeppelin/contracts-upgradeable (npm)from 4.1.0 before 4.7.1GitHub Advisory Database
openzeppelin contractsfrom 4.1.0 before 4.7.1NVD

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Classification

CWE-20CWE-347

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

OpenZeppelin Contracts is a library for smart contract development. Versions 4.1.0 until 4.7.1 are vulnerable to the SignatureChecker reverting. `SignatureChecker.isValidSignatureNow` is not expected to 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-1271 as expected. The contracts that may be affected are those that use `SignatureChecker` to check the validity of a signature and handle invalid signatures in a way other than reverting. The issue was patched in version 4.7.1.

GitHub Advisory Database
Impact

SignatureChecker.isValidSignatureNow is not expected to 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-1271 as expected.

The contracts that may be affected are those that use SignatureChecker to check the validity of a signature and handle invalid signatures in a way other than reverting. We believe this to be unlikely.

Patches

The issue was patched in 4.7.1.

References

https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3552

For more information

If you have any questions or comments about this advisory, or need assistance deploying the fix, email us at security@openzeppelin.com.

NVD (es)

OpenZeppelin Contracts es una biblioteca para el desarrollo de contratos inteligentes. Las versiones 4.1.0 hasta 4.7.1, son vulnerables a una reversión de SignatureChecker. No es esperado que "SignatureChecker.isValidSignatureNow" revierta. Sin embargo, una suposición incorrecta sobre "abi.decode" de Solidity versión 0.8 permite que algunos casos sean revertidos, dado un contrato de destino que no implementa EIP-1271 como es esperado. Los contratos que pueden verse afectados son los que usan "SignatureChecker" para comprobar la validez de una firma y manejar las firmas no válidas de una forma distinta a la reversión. El problema fue parcheado en versión 4.7.1

References

Sources

SourceRecordLicence
CVE ListCVE-2022-31172 changed 2025-04-23CVE Terms of Use
GitHub Advisory DatabaseGHSA-4g63-c64m-25w9 changed 2023-11-08CC-BY-4.0
NVDCVE-2022-31172 changed 2026-06-17Public domain