omit the copy value actions from the transaction diagram context menus when amounts are hidden
What changed, and why it matters
This commit removes the 'Copy Value' right-click menu options from transaction diagrams when the user has turned on the 'Hide amounts' privacy setting. Previously, even with amounts hidden on screen, a user could still right-click a transaction label and copy the exact value to the clipboard, which would leak the supposedly hidden amount. This is a minor privacy/UI consistency fix, not a remote attack.
No urgent action required. Treat as a routine privacy-hardening patch. Users who rely on 'Hide amounts' should update to a build containing this commit to prevent accidental clipboard leakage of balances.
Security signals we found
Privacy bypass via clipboard: hidden amounts still exposed through context menu copy actions
UI state inconsistency between visible labels and context-menu capabilities
Local information-disclosure fix only; no memory corruption, remote vector, or cryptographic weakness
Evidence from the diff
TransactionDiagram.java’s LabelContextMenu always added ‘Copy Value in sats’ and ‘Copy Value in BTC’ items regardless of Config.get().isHideAmounts(). The patch wraps those MenuItem creations in an if(!Config.get().isHideAmounts()) guard and also skips adding a context menu to the fee label when amounts are hidden. This prevents clipboard exposure of values the user asked to hide.
Changed components
src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.javaTransaction diagram context menus (LabelContextMenu)Fee label context menuInspect captured patch +19 / −17
### src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java
@@ -796,7 +796,7 @@ private Pane getOutputsLabels(List<WalletTransaction.Output> displayedOutputs) {
outputsBox.getChildren().add(feeBox);
outputsBox.getChildren().add(createSpacer());
- if(walletTx.getFee() >= 0) {
+ if(walletTx.getFee() >= 0 && !Config.get().isHideAmounts()) {
ContextMenu contextMenu = new LabelContextMenu(null, walletTx.getFee());
feeLabel.setContextMenu(contextMenu);
}
@@ -1273,22 +1273,24 @@ public LabelContextMenu(Address address, long value, PaymentCode paymentCode, Si
getItems().add(showAddress);
}
- MenuItem copySatsValue = new MenuItem("Copy Value in sats");
- copySatsValue.setOnAction(event -> {
- hide();
- ClipboardContent content = new ClipboardContent();
- content.putString(Long.toString(value));
- Clipboard.getSystemClipboard().setContent(content);
- });
- MenuItem copyBtcValue = new MenuItem("Copy Value in BTC");
- copyBtcValue.setOnAction(event -> {
- hide();
- ClipboardContent content = new ClipboardContent();
- UnitFormat format = Config.get().getUnitFormat() == null ? UnitFormat.DOT : Config.get().getUnitFormat();
- content.putString(format.formatBtcValue(value));
- Clipboard.getSystemClipboard().setContent(content);
- });
- getItems().addAll(copySatsValue, copyBtcValue);
+ if(!Config.get().isHideAmounts()) {
+ MenuItem copySatsValue = new MenuItem("Copy Value in sats");
+ copySatsValue.setOnAction(event -> {
+ hide();
+ ClipboardContent content = new ClipboardContent();
+ content.putString(Long.toString(value));
+ Clipboard.getSystemClipboard().setContent(content);
+ });
+ MenuItem copyBtcValue = new MenuItem("Copy Value in BTC");
+ copyBtcValue.setOnAction(event -> {
+ hide();
+ ClipboardContent content = new ClipboardContent();
+ UnitFormat format = Config.get().getUnitFormat() == null ? UnitFormat.DOT : Config.get().getUnitFormat();
+ content.putString(format.formatBtcValue(value));
+ Clipboard.getSystemClipboard().setContent(content);
+ });
+ getItems().addAll(copySatsValue, copyBtcValue);
+ }
if(paymentCode != null) {
MenuItem copyPaymentCode = new MenuItem("Copy Payment Code");Why this scored 21/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.