RUSTSEC-2026-0501: Shamir backup recovery accepts a share at x = 0, so a supplied share can substitute the recovered private key

Published Nov 12, 2026
·
Updated

KeyShares::frombackupformat (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::recoverprivatekey 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.

Affected Software

2 affected componentsFixes available
rust/bsv-rs>=0.0.0-0<0.8.7
0.8.7
rust/bsv-rs>=0.9.0-beta.1<0.9.0-beta.7.0
0.9.0-beta.7.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rust/bsv-rs to a version that resolves this vulnerability.

    Fixed in 0.8.7
  2. Upgrade

    Upgrade rust/bsv-rs to a version that resolves this vulnerability.

    Fixed in 0.9.0-beta.7.0
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 0.8.7
  4. Compensating control

    Where upgrading is not possible, before recovering a Shamir backup, validate shares read by KeyShares::from_backup_format: split each share on '.', base58-decode the x field, and refuse the set if any x decodes to zero, is at or above the field prime, or is duplicated.

Event History

Nov 12, 2026
Advisory Published
via OSV·12:00 PM
Data Sourced
via OSV·12:00 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Applications are exposed when they recover Shamir backups from shares they did not produce, such as shares supplied from a custodian medium, pasted manually, or restored from another writer. Backups written by the crate's own writer do not contain the malformed share form.

2

What does an attacker need to do to control the recovered key?

The attacker must be able to supply a share to the recovery set with an x coordinate of zero, or the non-canonical equivalent x = p, and make its integrity tag match the honest set. That share's y value is then used as the recovered private key.

3

Which versions contain a fix?

Version 0.8.7 rejects these share sets before interpolation. The next prerelease in the 0.9 line includes the same rejection; the vulnerable reader behavior has been public since version 0.2.0.

4

What can be done if upgrading is not immediately possible?

Validate every share before recovery. Split each share on '.' into four fields, base58-decode the x field, and reject the set when the decoded x value is zero; the one-character x field "1" decodes to zero.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203