Skip to content

secretsharing: check that share ID is not zero.#644

Merged
bwesterb merged 1 commit into
mainfrom
bas/gw22
Jul 15, 2026
Merged

secretsharing: check that share ID is not zero.#644
bwesterb merged 1 commit into
mainfrom
bas/gw22

Conversation

@bwesterb

@bwesterb bwesterb commented Jul 15, 2026

Copy link
Copy Markdown
Member

Recover() didn't check whether the share ID is zero, which allows one manipulated share to determine the final recovered secret. The applicability is rather narrow: the Verify() function that checks secret commitments already did check whether the share ID is zero. Without calling Verify(), an attacker can already manipulate the shared secret already to a certain degree. Arguably, we wouldn't need to check it here, but it's cheap to do so.


Open in Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

Recover() didn't check whether the share ID is zero, which allows one
manipulated share to determine the final recovered secret. The
applicability is rather narrow: the Verify() function that checks secret
commitments already did check whether the share ID is zero. Without
calling Verify(), an attacker can already manipulate the shared secret already
to a certain degree. Arguably, we wouldn't need to check it here, but
it's cheap to do so.
Comment thread secretsharing/ss_test.go
attackerValue := g.RandomScalar(rand.Reader)
tampered := make([]secretsharing.Share, 0, t+1)
tampered = append(tampered, secretsharing.Share{
ID: g.NewScalar(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional, to make it a little more clear that this is the zero ID.

Suggested change
ID: g.NewScalar(),
ID: g.NewScalar(), // a zero-valued scalar, the tampered share

@bwesterb bwesterb merged commit 91a32fc into main Jul 15, 2026
14 checks passed
@bwesterb bwesterb deleted the bas/gw22 branch July 15, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants