{"id":"CVE-2023-23940","aliases":["CVE-2023-23940","GHSA-626q-v9j4-mcp4","PYSEC-2023-39"],"related":[],"kind":"vulnerability","state":"published","title":"OpenZeppelin Contracts for Cairo is vulnerable to signature validation bypass","summary":"OpenZeppelin Contracts for Cairo is a library for secure smart contract development written in Cairo for StarkNet, a decentralized ZK Rollup. `is_valid_eth_signature` is missing a call to `finalize_keccak` after calling `verify_eth_signature`. As a result, any contract using `is_valid_eth_signature` from the account library (such as the `EthAccount` preset) is vulnerable to a malicious sequencer. Specifically, the malicious sequencer would be able to bypass signature validation to impersonate an instance of these accounts. The issue has been patched in 0.6.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"OpenZeppelin Contracts for Cairo is a library for secure smart contract development written in Cairo for StarkNet, a decentralized ZK Rollup. `is_valid_eth_signature` is missing a call to `finalize_keccak` after calling `verify_eth_signature`. As a result, any contract using `is_valid_eth_signature` from the account library (such as the `EthAccount` preset) is vulnerable to a malicious sequencer. Specifically, the malicious sequencer would be able to bypass signature validation to impersonate an instance of these accounts. The issue has been patched in 0.6.1.","source":"cvelist"},{"lang":"en","text":"### Cause\n`is_valid_eth_signature` is missing a call to `finalize_keccak` after calling `verify_eth_signature`. \n\n### Impact\nAs a result, any contract using `is_valid_eth_signature` from the account library (such as the `EthAccount` preset) is vulnerable to a malicious sequencer. Specifically, the malicious sequencer would be able to bypass signature validation to impersonate an instance of these accounts.\n\n### Risk\nIn order to exploit this vulnerability, it is required to control a sequencer or prover since they're the ones executing the hints, being able to inject incorrect keccak results.\n\nToday StarkWare is the only party running both a prover or a sequencer, greatly reducing the risk of exploit.\n\n### Patches\nThe issue has been patched in 0.6.1.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [the Contracts for Cairo repository](https://github.com/OpenZeppelin/cairo-contracts/issues/new/choose)\n* Email us at [security@openzeppelin.com](mailto:security@openzeppelin.com)","format":"markdown","source":"ghsa"}],"published":"2023-02-02T16:59:46.000Z","modified":"2026-06-17T05:38:20.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:L","score":6.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:L","score":6.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-345","CWE-347"],"affected":[{"ranges":[{"version":">= 0.2.0, < 0.6.1","status":"affected"}],"vendor":"OpenZeppelin","product":"cairo-contracts","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0.2.0","status":"affected","fixed":"0.6.1"}],"ecosystem":"PyPI","package":"openzeppelin-cairo-contracts","purl":"pkg:pypi/openzeppelin-cairo-contracts","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"0.2.0","fixed":"0.6.1"}],"vendor":"openzeppelin","product":"contracts","cpe":"cpe:2.3:a:openzeppelin:contracts:*:*:*:*:*:cairo:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"6d4cb750478fca2fd916f73297632f899aca9299"},{"type":"ecosystem","introduced":"0.2.0","status":"affected","fixed":"0.6.1"}],"ecosystem":"PyPI","package":"openzeppelin-cairo-contracts","purl":"pkg:pypi/openzeppelin-cairo-contracts","repo":"https://github.com/OpenZeppelin/cairo-contracts","source":"pysec"}],"references":[{"url":"https://github.com/OpenZeppelin/cairo-contracts/security/advisories/GHSA-626q-v9j4-mcp4","tags":["advisory","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/OpenZeppelin/cairo-contracts/pull/542/commits/6d4cb750478fca2fd916f73297632f899aca9299","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-23940","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/OpenZeppelin/cairo-contracts","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/openzeppelin-cairo-contracts/PYSEC-2023-39.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-03-10T20:58:35.252Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-23940","url":"https://www.cve.org/CVERecord?id=CVE-2023-23940","licence":"CVE Terms of Use","modified":"2025-03-10T21:16:55.772Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-626q-v9j4-mcp4","url":"https://github.com/advisories/GHSA-626q-v9j4-mcp4","licence":"CC-BY-4.0","modified":"2026-02-22T22:56:17.554Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-23940","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-23940","licence":"Public domain","modified":"2026-06-17T05:38:20.130Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2023-39","url":"https://osv.dev/vulnerability/PYSEC-2023-39","licence":"CC-BY-4.0","modified":"2026-02-22T22:49:15.001Z"}],"updatedAt":"2026-11-25T22:58:21.828Z","epss":{"score":0.0023,"percentile":0.14849,"date":"2026-12-01T12:00:22.000Z"}}