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 package | Versions | Reported by |
|---|---|---|
| OpenZeppelin openzeppelin-contracts | >= 4.1.0, < 4.7.1 | CVE List |
| @openzeppelin/contracts (npm) | from 4.1.0 before 4.7.1 | GitHub Advisory Database |
| @openzeppelin/contracts-upgradeable (npm) | from 4.1.0 before 4.7.1 | GitHub Advisory Database |
| openzeppelin contracts | from 4.1.0 before 4.7.1 | NVD |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Classification
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
| https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-4g63-c64m-25w9 | third-party-advisory, web | |
| https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3552 | patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-31172 | advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-31172 changed 2025-04-23 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-4g63-c64m-25w9 changed 2023-11-08 | CC-BY-4.0 |
| NVD | CVE-2022-31172 changed 2026-06-17 | Public domain |