GHSA-v935-pqmr-g8v9: Num bigint Unexpected Panics Vulnerability

MODERATE
CWE-20 CWE-131
Published
Advisory Summary

GHSA-v935-pqmr-g8v9 is a MODERATE unexpected panics vulnerability (CWE-20: Improper Input Validation) affecting Num bigint libraries in the crates.io ecosystem. The issue involves unexpected panics in num-bigint. Remediation is available by upgrading affected packages to version 0.4.3.

GHSA-v935-pqmr-g8v9 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-v935-pqmr-g8v9
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product Num bigint
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-v935-pqmr-g8v9

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

num-bigint fixed: 0.4.3
Upgrade num-bigint to 0.4.3
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 num-bigint

How to Check if You Are Affected

To determine whether your application is affected by GHSA-v935-pqmr-g8v9, inspect your project dependencies for Num bigint:

inspect dependencies for num-bigint

Analyze the terminal output to locate any version of Num bigint in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.3), 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 CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Num bigint, 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

### Impact Two scenarios were reported where `BigInt` and `BigUint` multiplication may unexpectedly panic. - The internal `mac3` function did not expect the possibility of non-empty all-zero inputs, leading to an `unwrap()` panic. - A buffer was allocated with less capacity than needed for an intermediate result, leading to an assertion panic. Rust panics can either cause stack unwinding or program abort, depending on the application configuration. In some settings, an unexpected panic may constitute a denial-of-service vulnerability. ### Patches Both problems were introduced in version 0.4.1, and are fixed in version 0.4.3. ### For more information If you have any questions or comments about this advisory, please open an issue in the [num-bigint](https://github.com/rust-num/num-bigint) repo. ### Acknowledgements Thanks to Guido Vranken and Arvid Norberg for privately reporting these issues to the author. ### References * [GHSA-v935-pqmr-g8v9](https://github.com/rust-num/num-bigint/security/advisories/GHSA-v935-pqmr-g8v9) * [num-bigint#228](https://github.com/rust-num/num-bigint/pull/228)

GHSA-v935-pqmr-g8v9 Affected Num bigint Versions

1 component(s)
Fixed Versions:
0.4.3
Product / Package Ecosystem Affected Versions Fixed Version
num-bigint
crates.io
≥ 0.4.1
< 0.4.3
0.4.3

References

Frequently Asked Questions

What is GHSA-v935-pqmr-g8v9?
GHSA-v935-pqmr-g8v9 is a security vulnerability in Num bigint involving Unexpected panics in num-bigint under CWE-20: Improper Input Validation.
Which Num bigint versions are affected?
Affected versions include releases prior to 0.4.3 across affected packages: num-bigint.
What version fixes GHSA-v935-pqmr-g8v9?
Upgrading to 0.4.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is num-bigint affected?
Yes, num-bigint is affected in releases prior to 0.4.3. Upgrade your dependency to 0.4.3 or later.
What CWE is associated with GHSA-v935-pqmr-g8v9?
GHSA-v935-pqmr-g8v9 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check crates.io dependencies for GHSA-v935-pqmr-g8v9?
Run the dependency tree command: 'inspect dependencies for num-bigint'. 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-v935-pqmr-g8v9",
  "modified" : "2021-11-03T15:02:32Z",
  "published" : "2021-11-03T17:36:04Z",
  "aliases" : [ ],
  "summary" : "Unexpected panics in num-bigint",
  "details" : "### Impact\n\nTwo scenarios were reported where `BigInt` and `BigUint` multiplication may unexpectedly panic.\n\n- The internal `mac3` function did not expect the possibility of non-empty all-zero inputs, leading to an `unwrap()` panic.\n- A buffer was allocated with less capacity than needed for an intermediate result, leading to an assertion panic.\n\nRust panics can either cause stack unwinding or program abort, depending on the application configuration. In some settings, an unexpected panic may constitute a denial-of-service vulnerability.\n\n### Patches\nBoth problems were introduced in version 0.4.1, and are fixed in version 0.4.3.\n\n### For more information\nIf you have any questions or comments about this advisory, please open an issue in the [num-bigint](https://github.com/rust-num/num-bigint) repo.\n\n### Acknowledgements\nThanks to Guido Vranken and Arvid Norberg for privately reporting these issues to the author.\n\n### References\n* [GHSA-v935-pqmr-g8v9](https://github.com/rust-num/num-bigint/security/advisories/GHSA-v935-pqmr-g8v9)\n* [num-bigint#228](https://github.com/rust-num/num-bigint/pull/228)\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "num-bigint"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.4.1"
      }, {
        "fixed" : "0.4.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rust-num/num-bigint/security/advisories/GHSA-v935-pqmr-g8v9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rust-num/num-bigint/pull/228"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rust-num/num-bigint"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-131", "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-03T15:02:32Z",
    "nvd_published_at" : null
  }
}