Skip to content

fix dep and sec issues#7

Merged
dhuseby merged 1 commit into
mainfrom
fix/deps-sec-issues
Jul 15, 2026
Merged

fix dep and sec issues#7
dhuseby merged 1 commit into
mainfrom
fix/deps-sec-issues

Conversation

@dhuseby

@dhuseby dhuseby commented Jul 15, 2026

Copy link
Copy Markdown
Member

multi-sig silently swallows malformed ThresholdData
multi-sig/src/views/bls12381.rs:554,645,688:

Ok(b) => ThresholdData::try_from(b).unwrap_or_default(),

If ThresholdData parsing fails (corruption, truncation, tampering), unwrap_or_default() returns an empty ThresholdData. The caller then sees zero shares and may proceed with an empty threshold set. This is a fail-open pattern — corrupted security-critical data is silently replaced with a safe-looking default rather than surfacing an error.

fix: Propagate the error with ? or return a ThresholdError::InvalidThresholdData.

multi-sig duplicate share identifiers silently overwrite
multi-sig/src/views/bls12381.rs:314 and multi-key/src/views/bls12381.rs (analogous) — shares.insert(identifier, sdata) silently overwrites an existing share with the same identifier. In threshold reconstruction, a duplicate identifier means one participant's share is lost, potentially dropping below the threshold without any error.

fix: Check contains_key before insert and return DuplicateShare error.

multi-sig BLS codec inferred from signature length
multi-sig/src/views/bls12381.rs:419-429 and multi-key/src/views/bls12381.rs:459-465 — The BLS curve (G1 vs G2) is selected by signature byte length (48 → G1, 96 → G2). This is a heuristic, not cryptographic binding. A 48-byte G2 signature or 96-byte G1 signature would be misclassified. If downstream code trusts the codec tag for curve selection, this could cause verification on the wrong curve.

fix: Require explicit codec specification rather than length-based inference, or document that this heuristic is a known limitation.

multi-sig inconsistent error handling between G1/G2 combine
multi-sig/src/views/bls12381.rs:685-688 (G2 path) uses av.payload_encoding().ok() (optional — silently proceeds if missing), while line 740 (G1 path) uses av.payload_encoding()? (required — returns error). This asymmetry means G2 combine silently accepts missing payload encoding while G1 rejects it.

multi-sig typo in error message
multi-sig/src/error.rs:74"Signature missing limi" should be "Signature missing limit".

Signed-off-by: Dave Grantham dave@cryptid.tech

Signed-off-by: Dave Grantham <dave@cryptid.tech>
@dhuseby
dhuseby merged commit de3a0e6 into main Jul 15, 2026
1 check passed
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.

1 participant