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

- Severity: Critical 9.1 (CVSS:3.1, scored by RustSec Advisory Database) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-11-12T12:00:00.000Z
- Modified: 2026-11-12T08:00:03.177Z
- Also known as: RUSTSEC-2026-0501

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

(As written by RustSec Advisory Database.)

## Affected

- bsv-rs (crates.io): from 0.0.0-0 before 0.8.7; from 0.9.0-beta.1 before 0.9.0-beta.7.0

## References

- <https://crates.io/crates/bsv-rs> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0501.html> (advisory)
- <https://github.com/Calhooon/bsv-rs/blob/v0.8.7/CHANGELOG.md> (web)
- <https://github.com/Calhooon/bsv-rs/issues/854> (report)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0501](https://rustsec.org/advisories/RUSTSEC-2026-0501.html), CC0-1.0, modified 2026-11-12

---

Page: https://cve.day/GHSA-cwxv-4866-5gq2 · Whole record: https://cve.day/GHSA-cwxv-4866-5gq2.json · Rebuilt by cve.day 2026-11-25T22:56:43.490Z
