show the remote bitcoin core node warning from the terminal server settings
What changed, and why it matters
This commit moves an existing user warning about connecting to a remote Bitcoin Core node into a shared helper, and now also displays that same warning in the terminal (command-line) version of Sparrow. It does not change how connections are made or fix a vulnerability. It only makes the warning appear in one additional place so terminal users see the same caution as desktop users.
No security action required. Treat as a normal UX/consistency improvement. If reviewing for release notes, note that the terminal UI now surfaces the same remote-node warning as the desktop UI.
Security signals we found
Refactor of existing security warning only
No change to network or cryptographic behavior
No privilege boundary crossed
No input parsing or memory safety change
Evidence from the diff
The change refactors showRemoteCoreServerWarning() and isRemoteNode() from ServerSettingsController into static methods on AppServices. The GUI settings controller now delegates to the shared helper and tracks whether it has already been shown. The terminal settings dialog (ServerProxyDialog) calls the same helper after Done and Test actions. The warning logic itself is unchanged: it detects non-local/non-onion Bitcoin Core RPC hosts and warns that direct connections may expose the user’s IP, RPC credentials, and wallet descriptors. No connection behavior, proxy routing, or certificate handling is modified.
Changed components
Sparrow Wallet desktop GUI server settingsSparrow Wallet terminal server settingsAppServices shared warning helperInspect captured patch +56 / −43
### src/main/java/com/sparrowwallet/sparrow/AppServices.java
@@ -1032,6 +1032,58 @@ public static Optional<ButtonType> showWarningDialog(String title, String conten
return showAlertDialog(title, content, Alert.AlertType.WARNING, buttons);
}
+ /**
+ * Warns, without blocking the connection, that the configured Bitcoin Core node is neither on this computer or local network nor an onion address.
+ * Returns whether the warning was shown, so that each settings view can show it once.
+ */
+ public static boolean showRemoteCoreServerWarning(Config config) {
+ Server coreServer = config.getCoreServer();
+ if(config.getServerType() == ServerType.BITCOIN_CORE && isRemoteNode(coreServer)) {
+ //A host that is not an IP literal is not resolved here, so it can only be reported as unconfirmed
+ String location = IpAddressMatcher.isIpLiteral(coreServer.getHost()) ? " is not on" : " could not be confirmed to be on";
+ StringBuilder warning = new StringBuilder("Bitcoin Core at " + coreServer.getHostAndPort() + location + " this computer or your local network.\n");
+ if(isUsingProxy()) {
+ String proxy = config.isUseProxy() ? "configured proxy" : "internal Tor proxy";
+ warning.append("\nConnections to Bitcoin Core are made directly, and the " + proxy + " is only used for onion addresses. ");
+ warning.append("Your IP address will be visible to the node.\n");
+ }
+ if(coreServer.getProtocol() == Protocol.HTTP) {
+ warning.append("\nThe RPC credentials and wallet descriptors sent to it are unencrypted, and can be read by anyone on the network path.\n");
+ } else if(Storage.getCertificateFile(coreServer.getHost()) == null) {
+ warning.append("\nThe certificate presented by the node on the first connection will be trusted and required on all connections thereafter.\n");
+ }
+ warning.append("\nConnecting to the Bitcoin Core RPC interface over an untrusted network is not recommended by either Sparrow or Bitcoin Core. ");
+ warning.append("Consider using a node on this computer or your local network, connecting over a Tor onion address, or tunnelling to it over a VPN or SSH.");
+
+ showWarningDialog("Remote Bitcoin Core node", warning.toString());
+ return true;
+ }
+
+ return false;
+ }
+
+ private static boolean isRemoteNode(Server coreServer) {
+ if(coreServer == null || coreServer.isOnionAddress()) {
+ return false;
+ }
+
+ String host = coreServer.getHost();
+ if(IpAddressMatcher.isLocalNetworkName(host)) {
+ return false;
+ }
+
+ if(!IpAddressMatcher.isIpLiteral(host)) {
+ //Resolving a hostname here would block the user interface thread, and an unresolved host cannot be shown to be local
+ return true;
+ }
+
+ try {
+ return !IpAddressMatcher.isLocalNetworkAddress(host);
+ } catch(IllegalArgumentException e) {
+ return true;
+ }
+ }
+
public static Optional<ButtonType> showErrorDialog(String title, String content, ButtonType... buttons) {
return showAlertDialog(title, content == null ? "See log file (Help menu)" : content, Alert.AlertType.ERROR, buttons);
}
### src/main/java/com/sparrowwallet/sparrow/settings/ServerSettingsController.java
@@ -876,49 +876,8 @@ private boolean isCoreAliasEntered(Server aliasServer) {
}
private void showRemoteCoreServerWarning(Config config) {
- Server coreServer = config.getCoreServer();
- if(!coreServerWarningShown && config.getServerType() == ServerType.BITCOIN_CORE && isRemoteNode(coreServer)) {
- coreServerWarningShown = true;
-
- //A host that is not an IP literal is not resolved here, so it can only be reported as unconfirmed
- String location = IpAddressMatcher.isIpLiteral(coreServer.getHost()) ? " is not on" : " could not be confirmed to be on";
- StringBuilder warning = new StringBuilder("Bitcoin Core at " + coreServer.getHostAndPort() + location + " this computer or your local network.\n");
- if(AppServices.isUsingProxy()) {
- String proxy = config.isUseProxy() ? "configured proxy" : "internal Tor proxy";
- warning.append("\nConnections to Bitcoin Core are made directly, and the " + proxy + " is only used for onion addresses. ");
- warning.append("Your IP address will be visible to the node.\n");
- }
- if(coreServer.getProtocol() == Protocol.HTTP) {
- warning.append("\nThe RPC credentials and wallet descriptors sent to it are unencrypted, and can be read by anyone on the network path.\n");
- } else if(Storage.getCertificateFile(coreServer.getHost()) == null) {
- warning.append("\nThe certificate presented by the node on the first connection will be trusted and required on all connections thereafter.\n");
- }
- warning.append("\nConnecting to the Bitcoin Core RPC interface over an untrusted network is not recommended by either Sparrow or Bitcoin Core. ");
- warning.append("Consider using a node on this computer or your local network, connecting over a Tor onion address, or tunnelling to it over a VPN or SSH.");
-
- AppServices.showWarningDialog("Remote Bitcoin Core node", warning.toString());
- }
- }
-
- private boolean isRemoteNode(Server coreServer) {
- if(coreServer == null || coreServer.isOnionAddress()) {
- return false;
- }
-
- String host = coreServer.getHost();
- if(IpAddressMatcher.isLocalNetworkName(host)) {
- return false;
- }
-
- if(!IpAddressMatcher.isIpLiteral(host)) {
- //Resolving a hostname here would block the user interface thread, and an unresolved host cannot be shown to be local
- return true;
- }
-
- try {
- return !IpAddressMatcher.isLocalNetworkAddress(host);
- } catch(IllegalArgumentException e) {
- return true;
+ if(!coreServerWarningShown) {
+ coreServerWarningShown = AppServices.showRemoteCoreServerWarning(config);
}
}
### src/main/java/com/sparrowwallet/sparrow/terminal/settings/ServerProxyDialog.java
@@ -28,6 +28,7 @@ public ServerProxyDialog(String title) {
protected void onDone() {
close();
+ AppServices.showRemoteCoreServerWarning(Config.get());
Platform.runLater(() -> {
if(Config.get().getMode() == Mode.ONLINE && !(AppServices.isConnecting() || AppServices.isConnected())) {
@@ -38,6 +39,7 @@ protected void onDone() {
protected void onTest() {
close();
+ AppServices.showRemoteCoreServerWarning(Config.get());
ServerTestDialog serverTestDialog = new ServerTestDialog();
serverTestDialog.showDialog(SparrowTerminal.get().getGui());Why this scored 17/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.