GHSA-rjjm-x32p-m3f7: Github.com/consensys/gnark Gnark's Range Checker Gadget Allows Vulnerability
LOWGHSA-rjjm-x32p-m3f7 is a LOW (CVSS 3.2) gnark's range checker gadget allows vulnerability (General Security Weakness) affecting Github.com/consensys/gnark libraries in the Go ecosystem. The issue involves gnark's range checker gadget allows wider inputs up to word alignment. Remediation is available by upgrading affected packages to version 0.9.2.
GHSA-rjjm-x32p-m3f7 at a Glance
Security Impact
CVSS: 3.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N).
How to Fix GHSA-rjjm-x32p-m3f7
To remediate this vulnerability, upgrade all affected Github.com/consensys/gnark dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/consensys/gnark to 0.9.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/consensys/gnark
How to Check if You Are Affected
To determine whether your application is affected by GHSA-rjjm-x32p-m3f7, inspect your project dependencies for Github.com/consensys/gnark:
inspect dependencies for github.com/consensys/gnark
Analyze the terminal output to locate any version of Github.com/consensys/gnark in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under General Security Weakness. In Github.com/consensys/gnark, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-rjjm-x32p-m3f7 Affected Github.com/consensys/gnark Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/consensys/gnark
|
Go |
< 0.9.2
|
0.9.2
|
References
Frequently Asked Questions
What is GHSA-rjjm-x32p-m3f7?
Which Github.com/consensys/gnark versions are affected?
What version fixes GHSA-rjjm-x32p-m3f7?
Is github.com/consensys/gnark affected?
What is the CVSS score of GHSA-rjjm-x32p-m3f7?
What CWE is associated with GHSA-rjjm-x32p-m3f7?
How can I check Go dependencies for GHSA-rjjm-x32p-m3f7?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rjjm-x32p-m3f7",
"modified" : "2023-11-12T15:56:48Z",
"published" : "2023-11-12T15:56:48Z",
"aliases" : [ ],
"summary" : "gnark's range checker gadget allows wider inputs up to word alignment",
"details" : "### 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).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/consensys/gnark"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.9.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Consensys/gnark/security/advisories/GHSA-rjjm-x32p-m3f7"
}, {
"type" : "WEB",
"url" : "https://github.com/Consensys/gnark/issues/897"
}, {
"type" : "WEB",
"url" : "https://github.com/Consensys/gnark/commit/f528807119e9443df94b8c01fe8ee65abe3c75d8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Consensys/gnark"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2023-11-12T15:56:48Z",
"nvd_published_at" : null
}
}