GHSA-f77q-r5qm-w4m8: Sp1 recursion gnark ffi Sp1-recursion-gnark-ffi Has Insufficient Range Checks Vulnerability

MODERATE
CVSS 5.3
Published
Advisory Summary

GHSA-f77q-r5qm-w4m8 is a MODERATE (CVSS 5.3) sp1-recursion-gnark-ffi has insufficient range checks vulnerability (General Security Weakness) affecting Sp1 recursion gnark ffi libraries in the crates.io ecosystem. The issue involves sp1-recursion-gnark-ffi has insufficient range checks of babybear arithmetic. Remediation is available by upgrading affected packages to version 1.2.0.

GHSA-f77q-r5qm-w4m8 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-f77q-r5qm-w4m8
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification General Security Weakness
Affected Product Sp1 recursion gnark ffi
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-f77q-r5qm-w4m8

To remediate this vulnerability, upgrade all affected Sp1 recursion gnark ffi dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sp1-recursion-gnark-ffi fixed: 1.2.0
Upgrade sp1-recursion-gnark-ffi to 1.2.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for sp1-recursion-gnark-ffi

How to Check if You Are Affected

To determine whether your application is affected by GHSA-f77q-r5qm-w4m8, inspect your project dependencies for Sp1 recursion gnark ffi:

inspect dependencies for sp1-recursion-gnark-ffi

Analyze the terminal output to locate any version of Sp1 recursion gnark ffi in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.0), 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 Sp1 recursion gnark ffi, 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

The Gnark recursion circuit constrains arithmetic over BabyBear when the native field of the ZKP circuit is the BN254 scalar field. Proper implementation of this logic requires range checking Bn254 values to be less than the BabyBear modulus. In versions < 1.2.0, functions like `InvF` and `InvE` used values generated by hints that were not appropriately range checked. These issues are resolved in versions 1.2.0 and higher, by adding range checks in the appropriate places. This code was covered under the original audit scope of the recursion circuit audit by Veridise, and both Veridise and Kalos revisited the code for similar issues and found no additional vulnerabilities. This issue was discovered by the Succinct team on September 3rd. The issue was fixed and resolved within 48 hours, and released with V1.2.0 (note that a later V2.0.0 release has the same contents as V1.2.0 to respect semver), with production SP1 users being notified and upgraded immediately. The V1.1.0 verifier was frozen on September 4th to ensure that no one uses versions of SP1 with this bug.

GHSA-f77q-r5qm-w4m8 Affected Sp1 recursion gnark ffi Versions

1 component(s)
Fixed Versions:
1.2.0
Product / Package Ecosystem Affected Versions Fixed Version
sp1-recursion-gnark-ffi
crates.io
< 1.2.0
1.2.0

References

Frequently Asked Questions

What is GHSA-f77q-r5qm-w4m8?
GHSA-f77q-r5qm-w4m8 is a security vulnerability in Sp1 recursion gnark ffi involving sp1-recursion-gnark-ffi has insufficient range checks of BabyBear arithmetic under General Security Weakness.
Which Sp1 recursion gnark ffi versions are affected?
Affected versions include releases prior to 1.2.0 across affected packages: sp1-recursion-gnark-ffi.
What version fixes GHSA-f77q-r5qm-w4m8?
Upgrading to 1.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sp1-recursion-gnark-ffi affected?
Yes, sp1-recursion-gnark-ffi is affected in releases prior to 1.2.0. Upgrade your dependency to 1.2.0 or later.
What is the CVSS score of GHSA-f77q-r5qm-w4m8?
GHSA-f77q-r5qm-w4m8 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with GHSA-f77q-r5qm-w4m8?
GHSA-f77q-r5qm-w4m8 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-f77q-r5qm-w4m8?
Run the dependency tree command: 'inspect dependencies for sp1-recursion-gnark-ffi'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f77q-r5qm-w4m8",
  "modified" : "2024-10-29T15:37:50Z",
  "published" : "2024-10-29T15:37:50Z",
  "aliases" : [ ],
  "summary" : "sp1-recursion-gnark-ffi has insufficient range checks of BabyBear arithmetic ",
  "details" : "The Gnark recursion circuit constrains arithmetic over BabyBear when the native field of the ZKP circuit is the BN254 scalar field. Proper implementation of this logic requires range checking Bn254 values to be less than the BabyBear modulus.\n\nIn versions < 1.2.0, functions like `InvF` and `InvE` used values generated by hints that were not appropriately range checked. These issues are resolved in versions 1.2.0 and higher, by adding range checks in the appropriate places. This code was covered under the original audit scope of the recursion circuit audit by Veridise, and both Veridise and Kalos revisited the code for similar issues and found no additional vulnerabilities.\n\nThis issue was discovered by the Succinct team on September 3rd. The issue was fixed and resolved within 48 hours, and released with V1.2.0 (note that a later V2.0.0 release has the same contents as V1.2.0 to respect semver), with production SP1 users being notified and upgraded immediately. The V1.1.0 verifier was frozen on September 4th to ensure that no one uses versions of SP1 with this bug.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "sp1-recursion-gnark-ffi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/succinctlabs/sp1/security/advisories/GHSA-f77q-r5qm-w4m8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/succinctlabs/sp1/commit/8600d4aa63184ce3df7ccd30c79ac0388eacca52"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/succinctlabs/sp1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-29T15:37:50Z",
    "nvd_published_at" : null
  }
}