{"id":"CVE-2023-44378","published":"2023-10-09T13:33:54Z","modified":"2024-09-19T13:52:13Z","title":"gnark vulnerable to unsoundness in variable comparison/non-unique binary decomposition","vendor":"Consensys","product":"gnark","tier":"tail","description":{"text":"gnark is a zk-SNARK library that offers a high-level API to design circuits. Prior to version 0.9.0, for some in-circuit values, it is possible to construct two valid decomposition to bits. In addition to the canonical decomposition of `a`, for small values there exists a second decomposition for `a+r` (where `r` is the modulus the values are being reduced by). The second decomposition was possible due to overflowing the field where the values are defined. Upgrading to version 0.9.0 should fix the issue without needing to change the calls to value comparison methods.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.1,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00319,"percentile":0.17228,"provenance":"source"},"cwes":[{"id":"CWE-191","name":"Integer Underflow (Wrap or Wraparound)"},{"id":"CWE-697","name":"Incorrect Comparison"}],"references":[{"url":"https://github.com/Consensys/gnark/security/advisories/GHSA-498w-5j49-vqjg","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/zkopru-network/zkopru/issues/116","tags":["x_refsource_MISC"]},{"url":"https://github.com/Consensys/gnark/commit/59a4087261a6c73f13e80d695c17b398c3d0934f","tags":["x_refsource_MISC"]}],"priority":{"score":8.4,"factors":[{"name":"EPSS percentile","points":3.45},{"name":"CVSS severity","points":4.97}]},"vendorSlug":"consensys","affectedVersions":[{"vendor":"Consensys","product":"gnark","versions":["< 0.9.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-09-19T13:15:07.624734Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"github.com/consensys/gnark","vulnerableRanges":["<0.9.0"],"patched":["0.9.0"],"from":["GHSA-498w-5j49-vqjg","GO-2023-2098"],"provenance":"source"}],"summary":{"text":"Sentence 1: The flaw is in the variable comparison and binary decomposition logic of gnark, a zk-SNARK library's high-level circuit-design API, where some in-circuit values can be decomposed into bits in two valid ways. Sentence 2: An attacker with local access and no privileges can exploit this, without user interaction, to make a circuit accept a second valid decomposition (for small values, a second decomposition of a+r) that is not the canonical one, which affects integrity; the issue arises from field overflow and occurs in the affected versions, prior to 0.9.0.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:11:41Z"},"euvd":{"id":"EUVD-2023-2641","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-consensys-gnark-cve-2023-44378","children":[{"from":"CVE-2023-44378","to":"CVE-2024-45040","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["frontend/cs/r1cs/api.go","internal/stats/latest.stats"],"commits":["https://github.com/Consensys/gnark/commit/59a4087261a6c73f13e80d695c17b398c3d0934f","https://github.com/Consensys/gnark/commit/afda68a38acca37becb8ba6d8982d03fee9559a0"],"basis":"rarely changed file"}]}]}}