GHSA-v935-pqmr-g8v9 Unexpected panics in num-bigint

Not scored Published

Unexpected panics in num-bigint multiplication can cause denial of service in applications using the library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is GHSA-v935-pqmr-g8v9?

GHSA-v935-pqmr-g8v9 is a denial of service vulnerability in num-bigint, published on 3 Nov 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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 repo.

Acknowledgements

Thanks to Guido Vranken and Arvid Norberg for privately reporting these issues to the author.

References

Which versions are affected by GHSA-v935-pqmr-g8v9?

2 open source packages ship an affected version, including num-bigint.

PackageAffectedFixed in
num-bigint crates.ioFrom 0.4.10.4.3
num-bigint crates.ioFrom 0.4.10.4.3

How do I fix GHSA-v935-pqmr-g8v9?

Upgrade num-bigint to 0.4.3 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is GHSA-v935-pqmr-g8v9 being exploited?

There is no known exploitation of GHSA-v935-pqmr-g8v9 in the wild and no public exploit code.

Sources

Is GHSA-v935-pqmr-g8v9 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free