Repository navigation
fix(security): reject zero guardian threshold when guardian set is non-empty - #700
Merged
nonsobethel0-dev merged 1 commit intoOct 19, 2026
Conversation
…n-empty (Parashield-Protocol#608) set_guardians previously accepted threshold=0 even with guardians configured, silently bypassing the multisig requirement while leaving the guardian set populated. Add a guard: if guardians.len() > 0, threshold must be >= 1. Clearing the guardian set (empty vec, threshold=0) remains allowed. Added four tests: valid positive threshold, clear-guardians path, zero threshold with non-empty set (must panic), and threshold > len (must panic). Closes Parashield-Protocol#608 Closes Parashield-Protocol#609 Closes Parashield-Protocol#610 Closes Parashield-Protocol#611
|
@aniokedianne Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #608
Closes #609
Closes #610
Closes #611
Changes
#608 — ClaimsProcessor zero guardian threshold
contracts/claims-processor/src/lib.rs—set_guardiansPreviously
threshold=0was accepted even whenguardianswas non-empty. This silently disabled the multisig requirement while leaving the guardian set populated, makingrequire_upgrade_guardian_approvalsunreachable in practice because threshold=0 causes the guard to short-circuit before any approval is checked.Fix: added a check immediately before the existing
threshold > guardians.len()guard:Clearing the guardian set (
guardians = [],threshold = 0) remains allowed — that is the documented way to revert to single-admin mode.Tests added (
contracts/claims-processor/src/test.rs):set_guardians_with_positive_threshold_succeeds— happy pathclear_guardians_with_zero_threshold_succeeds— clearing is still validset_guardians_rejects_zero_threshold_with_nonempty_set— must panic#15set_guardians_rejects_threshold_exceeding_guardian_count— existing invariant still holds