CRITICAL · CVSS 3.1 9.1

GHSA-cwxv-4866-5gq2: Shamir backup recovery accepts a share at x = 0, so a supplied share can substitute the recovered private key

Published 2026-11-12 · Updated 2026-11-12 · Also known as RUSTSEC-2026-0501

Summary

The bsv-rs crate improperly validates Shamir backup shares by allowing an x-coordinate of 0, enabling an attacker to dictate the resulting private key. Users of the affected versions must update to the patched releases to ensure secure key reconstruction.

Who is affected

This vulnerability affects applications using KeyShares::from_backup_format to recover Shamir backups from untrusted or external sources. By providing a malicious share with an x-coordinate of 0, an attacker can force the system to reconstruct their own chosen key instead of the legitimate one. If the system relies on the reconstructed private key for authentication or signing, the integrity and confidentiality of the entire system are compromised.

Exploitability

The vulnerability is rated as critical with a CVSS 3.1 score of 9.1, reflecting a low attack complexity and the lack of required privileges or user interaction. There is no EPSS score available, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
crates.io bsv-rs >= 0.0.0-0, < 0.8.7 0.8.7 cargo update -p bsv-rs --precise 0.8.7
crates.io bsv-rs >= 0.9.0-beta.1, < 0.9.0-beta.7.0 0.9.0-beta.7.0 cargo update -p bsv-rs --precise 0.9.0-beta.7.0

CVSS 3.1 vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Attack vectorNetwork
Attack complexityLow
Privileges requiredNone
User interactionNone
ScopeUnchanged
ConfidentialityHigh
IntegrityHigh
AvailabilityNone

FAQ

Does this vulnerability affect shares produced by bsv-rs itself?

No. The crate's own writer does not produce shares that trigger this vulnerability; the issue is specifically within the reader logic.

What is the primary risk of this flaw?

The primary risk is a total loss of security in the key recovery process, allowing an attacker to force the reconstruction of a private key they control.

What is the CWE for this vulnerability?

Not documented.

Original advisory description
`KeyShares::from_backup_format` (the Shamir backup share reader, public since 0.2.0, the crate's first release) accepted a share whose x coordinate is 0, and `KeyShares::recover_private_key` interpolates the shares at x = 0 to recover the key. At an x of 0 the interpolation answers that share's y value alone, so an attacker who supplies one share in that form - with the share's integrity tag ground to match the honest set's - chooses the recovered key outright. The non-canonical zero x = p works the same way, and a repeated x past the threshold window also passed. An application that recovers a Shamir backup from shares it did not produce - a custodian's medium, a share pasted by hand, a set restored from another writer - could be handed the attacker's key as the recovered one. A set the crate's own writer produces never carries such a share; the door is the reader. 0.8.7 refuses such a set before interpolating (the 0.9 line's next prerelease carries the same refusal). Where upgrading is not possible, before recovering split each share on `.` into four fields, base58-decode the x field, and refuse the set if it decodes to zero (the one-character field `1`, or a value at or above the field prime) or if two shares carry the same x.

References

Source records: RUSTSEC-2026-0501 (OSV.dev).