replace control characters in cosigner labels of an imported multisig configuration, and size alerts to include blank lines
What changed, and why it matters
This commit makes two small UI fixes in Sparrow Wallet. First, it strips hidden control characters from cosigner labels when importing a shared multisig wallet setup, preventing odd or misleading label display. Second, it fixes alert dialog height calculation so blank lines are counted, avoiding dialogs that are too short to show their full message. These are defensive hardening changes rather than fixes for active remote attacks.
Treat as routine defensive hardening. Review whether label sanitization should also apply to other user-editable fields and ensure the regex covers intended Unicode categories without over-sanitizing legitimate characters. No urgent action required absent additional context.
Security signals we found
Sanitization of user-supplied labels (control/format characters replaced)
UI dialog sizing fix to prevent content clipping
No explicit security framing in commit message or diff
No CVE, advisory, or researcher attribution present in supplied materials
Evidence from the diff
The patch addresses two separate UI/presentation issues. In SettingsController.java, imported multisig keystore labels are sanitized with a regex replacing Unicode control/format characters (Cc and Cf categories) with spaces. In DefaultInteractionServices.java, the alert dialog height calculation now treats each line as at least one line (Math.max(1, …)), so empty lines contribute to dialog height. The commit message and diff do not frame either change as a security vulnerability fix, but the control-character sanitization has mild security relevance because control characters in user-supplied labels could be used for visual spoofing or to disrupt UI rendering.
Changed components
Sparrow Wallet desktop applicationSettingsController.java - imported multisig keystore label handlingDefaultInteractionServices.java - alert dialog height sizingInspect captured patch +3 / −1
### src/main/java/com/sparrowwallet/sparrow/DefaultInteractionServices.java
@@ -50,7 +50,7 @@ public Optional<ButtonType> showAlert(String title, String content, Alert.AlertT
String[] lines = content.split("\r\n|\r|\n");
if(lines.length > 3 || OsType.getCurrent() == OsType.WINDOWS) {
- double numLines = Arrays.stream(lines).mapToDouble(line -> Math.ceil(TextUtils.computeTextWidth(Font.getDefault(), line, 0) / 300)).sum();
+ double numLines = Arrays.stream(lines).mapToDouble(line -> Math.max(1, Math.ceil(TextUtils.computeTextWidth(Font.getDefault(), line, 0) / 300))).sum();
alert.getDialogPane().setPrefHeight(200 + numLines * 20);
}
### src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java
@@ -952,6 +952,8 @@ public void existingWalletImported(ExistingWalletImportedEvent event) {
if(event.getExistingWalletId().equals(getWalletForm().getWalletId())) {
Wallet importedWallet = event.getImportedWallet();
List<Keystore> importedKeystores = importedWallet.getKeystores();
+ importedKeystores.stream().filter(keystore -> keystore.getLabel() != null)
+ .forEach(keystore -> keystore.setLabel(keystore.getLabel().replaceAll("[\\p{Cc}\\p{Cf}]+", " ").trim()));
List<Keystore> nonWatchKeystores = walletForm.getWallet().getKeystores().stream().filter(k -> k.isValid() && k.getSource() != KeystoreSource.SW_WATCH).collect(Collectors.toList());
//BIP129 requires a signer to verify its own key is present in the imported descriptor by an exact match, and not by a shortcut such as the master fingerprintWhy this scored 37/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.