fix: verify and close PM-22024 default wallet seed audit finding#1109
Open
fix: verify and close PM-22024 default wallet seed audit finding#1109
Conversation
3b2ef99 to
52266df
Compare
Audit finding A2-D (Least Authority, Feb 2026): WalletSeed must not implement Default. The previous impl returned Medium([0; 32]) — an all-zero seed producing predictable wallet keys. Removed in PR #804. The compile_fail doctest ensures WalletSeed::default() does not compile, preventing re-introduction of the vulnerability. JIRA: https://shielded.atlassian.net/browse/PM-22024 Made-with: Cursor
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.
Summary
Verify and formally close the Least Authority audit finding (A2 Issue D) regarding the
Defaultimplementation onWalletSeedthat produced an all-zero seed. The core fix was merged in PR #804; this PR adds a compile-time regression test preventing re-introduction.🎫 Ticket 📐 Engineering 🧪 Test Plan
Motivation
The Least Authority Node DIFF Audit (Feb 2026) identified that
WalletSeed::default()returnedSelf::Medium([0; 32])— a deterministic all-zero seed that could lead to predictable wallet key material and recoverable secret keys. This was classified as High severity.PR #804 removed the
Defaultimpl and replaced the single internal placeholder usage with an explicit initializer. Code analysis confirms the fix is complete: the placeholderWalletSeed::Short([0; 16])inClaimMintInfo::from_context()is always overwritten byset_rewards()beforebuild()uses it for key derivation. The Least Authority auditor (Mirco) confirmed the fix.Changes
compile_faildoctest onWalletSeedverifying.default()does not compile (E0599), preventing re-introduction of the vulnerability. Runs for both ledger_7 and ledger_8 module variants.📌 Submission Checklist
🔱 Fork Strategy
🗹 TODO before merging