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
.
Crates in the crates.io registry are tarball snapshots uploaded by crates' publishers. The registry is not using crates' git repositories. There is absolutely no guarantee that the repository URL declared by the crate belongs to the crate, or that the code in the repository is the code inside the published tarball.
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.