RUSTSEC-2024-0398
on 2024-11-16: Bias of Polynomial Coefficients in Secret Sharing
This crate has no reviews yet. To add a review, set up your cargo-crev
.
Lib.rs has been able to verify that all files in the crate's tarball are in the crate's repository. Please note that this check is still in beta, and absence of this confirmation does not mean that the files don't match.
Crates in the crates.io registry are tarball snapshots uploaded by crates' publishers. The registry is not using crates' git repositories, so there is a possibility that published crates have a misleading repository URL, or contain different code from the code in the repository.
To review the actual code of the crate, it's best to use cargo crev open sharks
. Alternatively, you can download the tarball of sharks v0.5.0 or view the source online.
Affected versions of this crate allowed for a bias when generating random polynomials for Shamir Secret Sharing, where instead of being within the range
[0, 255]
they were instead in the range[1, 255]
. A description from Cure53, who originally found the issue, is available:Secrets that have been shared a low amount of times (ideally, once) would not be impacted. However, secrets that are repeatedly shared may be vulnerable, especially if the shares are still available, and should be rotated.
The vulnerability does not impact reconstitution of secrets: secrets that have already been split can be recombined without issue.
The flaw can be corrected by changing the lower bound of the polynomial coefficient range in the
sharks::math::random_polynomial
function to0
. Theblahaj
crate has been made available with a fixed version of the code, after attempts to reach the maintainer of thesharks
crate were unsuccessful.