{"answers":{"affected":"3 open source packages ship an affected version, including github.com/consensys/gnark.","exploited":"There is no known exploitation of GHSA-rjjm-x32p-m3f7 in the wild and no public exploit code.","fix":"Upgrade github.com/consensys/gnark to a fixed version for your release line: 0.9.2 or 0.9.2-0.20231110170422-f528807119e9.","what":"GHSA-rjjm-x32p-m3f7 is a vulnerability in github.com/consensys/gnark, published on 12 Nov 2023."},"fix_prompt":"Check this codebase for GHSA-rjjm-x32p-m3f7 and fix it if it is affected.\n\nWhat it is: GHSA-rjjm-x32p-m3f7 is a vulnerability in github.com/consensys/gnark, published on 12 Nov 2023. \nExploitation: There is no known exploitation of GHSA-rjjm-x32p-m3f7 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/consensys/gnark (Go): affected all versions; fixed in 0.9.2\n- github.com/consensys/gnark (Go): affected all versions; fixed in 0.9.2\n- github.com/consensys/gnark (Go): affected all versions; fixed in 0.9.2-0.20231110170422-f528807119e9\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-rjjm-x32p-m3f7/ (Markdown: https://insights.sbomify.com/GHSA-rjjm-x32p-m3f7/index.md)","id":"GHSA-rjjm-x32p-m3f7","markdown":"https://insights.sbomify.com/GHSA-rjjm-x32p-m3f7/index.md","name":"GHSA-rjjm-x32p-m3f7","record":{"aliases":["GO-2023-2333"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["other"],"network_reachable":"unknown","non_default_config":false,"product_category":"Go ZK proof library","requires_auth":"none","summary":"A flaw in gnark's range checker allows inputs wider than intended, potentially affecting zero-knowledge proof integrity in dependent applications.","user_interaction":"not_required","vuln_class":"integer_overflow"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Impact\n\ngnark provides a gadget in the standard library to allow optimized checking of the bitwidth of the inputs. The gadget works by constructing a fixed lookup table containing all valid entries, partitioning the input and checking that all parts are inside the lookup table. The range checker gadget did not take into account that the highest partition may be less than the width limit, allowing the inputs to be up to 16 bits wider than checked.\n\nRange checking gadget is extensively used in field emulation. Users using any dependant gadget (ECDSA verification, proof recursion etc.) is impacted.\n\nWe consider the impact of the vulnerability being low as the number of attacker-modifiable bits is significantly smaller compared to the bit-width of scalar field modulus and it won't be possible to construct inputs which would allow to overflow the scalar field.\n\n### Patches\n\nThe issue has been patched in the stable branch of gnark. \n\nDue to low severity of the issue no emergency release will be issued and we follow the existing release plan. Versions v0.9.2 and higher are patched.\n\n### Workarounds\n\nWe consider the issue very hard to exploit and do not recommend manual remediation. However, it is possible to perform manual bit decomposition using `std/math/bits` gadget.\n\n### References\n\nInitial issue https://github.com/Consensys/gnark/issues/897\n\n### Acknowledgement\n\nThe issue was reported by [@ultrainstinct30](https://github.com/ultrainstinct30).","ecosystems":["Go"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"gnark's range checker gadget allows wider inputs up to word alignment","id":"GHSA-rjjm-x32p-m3f7","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Go","product":null,"products":[],"type":"integer_overflow","year":"2023"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"Go","fixed":["0.9.2"],"introduced":["0"],"last_affected":[],"package":"github.com/consensys/gnark","purl":null,"source":"GHSA-rjjm-x32p-m3f7"},{"ecosystem":"Go","fixed":["0.9.2"],"introduced":["0"],"last_affected":[],"package":"github.com/consensys/gnark","purl":"pkg:golang/github.com/consensys/gnark","source":"GHSA-rjjm-x32p-m3f7"},{"ecosystem":"Go","fixed":["0.9.2-0.20231110170422-f528807119e9"],"introduced":["0"],"last_affected":[],"package":"github.com/consensys/gnark","purl":"pkg:golang/github.com/consensys/gnark","source":"GO-2023-2333"}],"products":null,"published":"2023-11-12","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"A flaw in gnark's range checker allows inputs wider than intended, potentially affecting zero-knowledge proof integrity in dependent applications.","url":"https://insights.sbomify.com/GHSA-rjjm-x32p-m3f7/"}