revert the sighash selection when the sighash none warning is dismissed rather than answered no
What changed, and why it matters
This commit fixes a small UI bug in Sparrow Wallet's transaction signing dialog. When a user chooses the risky 'SIGHASH_NONE' option, Sparrow shows a warning asking if they are sure. Previously, clicking 'No' reverted the choice, but closing/dismissing the warning box without answering left the risky option selected. The fix now reverts the choice whenever the user does not explicitly click 'Yes'.
No immediate action beyond applying the patch. Users who sign transactions with custom sighash types should verify the selected sighash before signing, especially after dismissing warning dialogs.
Security signals we found
SIGHASH_NONE allows a signature to authorize any output layout, enabling transaction-replay or output-substitution attacks if misused
UI state inconsistency after dialog dismissal could leave a user unexpectedly signing with SIGHASH_NONE
Fix is a one-line guard tightening the revert condition
Evidence from the diff
In HeadersController.java, the warning dialog for SIGHASH_NONE returned an Optional
Changed components
src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.javaSIGHASH_NONE warning dialog handlingInspect captured patch +1 / −1
### src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java
@@ -560,7 +560,7 @@ public SigHash fromString(String string) {
Optional<ButtonType> optType = AppServices.showWarningDialog("Confirm Sighash None",
"A sighash value of none means the signature does not commit to any of the outputs, and can be reused on a transaction with different outputs.\n\nAre you sure?",
ButtonType.NO, ButtonType.YES);
- if(optType.isPresent() && optType.get() == ButtonType.NO) {
+ if(optType.isEmpty() || optType.get() != ButtonType.YES) {
Platform.runLater(() -> sigHash.getSelectionModel().select(oldValue));
return;
}Why this scored 44/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.