Fix: Reject multisig policies with m=0 or m>n and guard against ZeroDivisionError in fee calculation and #845
Open
odudex wants to merge 5 commits intoselfcustody:developfrom
Open
Fix: Reject multisig policies with m=0 or m>n and guard against ZeroDivisionError in fee calculation and #845odudex wants to merge 5 commits intoselfcustody:developfrom
odudex wants to merge 5 commits intoselfcustody:developfrom
Conversation
…e outputs Handles the case where all PSBT outputs are zero-value (e.g. OP_RETURN only transactions) by checking out_amount > 0 before dividing. Sets fee_percent to 100.0% when output amount is zero. Addresses audit C7.
Reject multisig policies with m=0 (zero signatures = anyone can spend) or m>n (impossible quorum) when loading wallets from BlueWallet INI format. Also adds defense-in-depth validation in descriptor loading path. Addresses security audit C8 of selfcustody#843.
04c71f0 to
8b535c2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #845 +/- ##
========================================
Coverage 97.31% 97.31%
========================================
Files 83 83
Lines 10581 10593 +12
========================================
+ Hits 10297 10309 +12
Misses 284 284 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
What is this PR for?
Reject multisig policies with m=0 (zero signatures = anyone can spend) or m>n (impossible quorum) when loading wallets from BlueWallet INI format. Also adds defense-in-depth validation in descriptor loading path. Addresses security audit C8 of Security Audit: 8 Critical + 12 High findings (AI-assisted audit) #843.
Handles the case where all PSBT outputs are zero-value (e.g. OP_RETURN only transactions) by checking out_amount > 0 before dividing. Sets fee_percent to 100.0% when output amount is zero. Addresses audit C7 of Security Audit: 8 Critical + 12 High findings (AI-assisted audit) #843..
Changes made to:
Did you build the code and tested on device?
What is the purpose of this pull request?