diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b24721..261bf46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ Releases before 1.4.5 are described on the [Releases](https://github.com/Dhiva-Labs/SecureShellGo/releases) page. -## 1.6.0 - 2026-11-15 +## 1.6.0 - 2026-11-16 The AI Bridge: let an AI assistant read from the servers you choose, read-only, without ever giving it a password or key. @@ -23,6 +23,7 @@ The AI Bridge: let an AI assistant read from the servers you choose, read-only, - A change to a paired assistant or to a server's AI access that cannot be written to disk is undone and reported, so what the app shows always matches what is stored. A revoke that cannot be saved says the pairing still works. - The manual route puts the token in your shell's history file when you paste its third command, and the screen says so under the commands; "Connect Claude Code" does not. Delete that history line afterwards, or revoke the assistant and pair again if the history is shared. - The activity log file is created so that only your user account can read it. +- An AI Bridge read on a server whose login shell is fish cannot be made to run text the app did not intend through a file name, folder or pattern that contains a backslash. Commands are quoted so that no login shell (fish included) reads a backslash as anything but a backslash. ### Added - AI Bridge, on Linux and Windows: let an MCP-compatible AI assistant on your computer read from your servers, by name, without ever being given a password or key. It is off by default. Switch on "AI Bridge" in Settings (the app explains what it does each time you switch it on), pair an assistant under "Connect an assistant" to get a token and a ready-made config snippet, then switch on "AI access (read-only)" for each server you want it to see. @@ -39,6 +40,11 @@ The AI Bridge: let an AI assistant read from the servers you choose, read-only, ### Changed - The AI Bridge is not available on Android or macOS. +### Fixed +- A backup no longer resets "Copy on select" to off when you restore it. +- Importing a backup no longer resets the app's language to the system default. +- An assistant that disconnects before the app has answered it no longer leaves an error behind in the app. + ## 1.5.1 - 2026-11-03 Smoother copy and paste in the terminal, less in the way across the app, and trusted server keys that are no longer lost or flagged without cause. diff --git a/debian/changelog b/debian/changelog index b0fa3d7..7553a05 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,9 +7,11 @@ secureshellgo (1.6.0~noble1) noble; urgency=medium time), "Shared hosts" and an Activity list of every call made; "Connect Claude Code" sets it up in one step where the claude program is found. * A secureshellgo-mcp launcher in every package; one-click connect is not - available in the snap or the Flatpak. The full list is in CHANGELOG.md. + available in the snap or the Flatpak. + * A backup keeps "Copy on select" and the app's language. + The full list is in CHANGELOG.md. - -- Dhiva Labs Sun, 15 Nov 2026 12:00:00 +0530 + -- Dhiva Labs Mon, 16 Nov 2026 22:00:00 +0530 secureshellgo (1.5.1~noble1) noble; urgency=medium diff --git a/docs/changes/README.md b/docs/changes/README.md index 47b9301..f830a2b 100644 --- a/docs/changes/README.md +++ b/docs/changes/README.md @@ -28,7 +28,6 @@ One file per piece of work, named for it: | `remote-ops.md` | Commands on many servers, archive and search actions | | `mosh.md` | Mosh | | `localization.md` | Translations | -| `backup-settings.md` | Backups no longer reset "Copy on select" | Write for the people using the app, in the sections `CHANGELOG.md` uses: `### Added`, `### Changed`, `### Fixed`, `### Security`. One line per change, diff --git a/docs/changes/backup-settings.md b/docs/changes/backup-settings.md deleted file mode 100644 index 1616a71..0000000 --- a/docs/changes/backup-settings.md +++ /dev/null @@ -1,4 +0,0 @@ -### Fixed - -- A backup no longer resets "Copy on select" to off when you restore it. -- Importing a backup no longer resets the app's language to the system default. diff --git a/docs/privacy-policy.md b/docs/privacy-policy.md index 920b5ee..80744aa 100644 --- a/docs/privacy-policy.md +++ b/docs/privacy-policy.md @@ -1,6 +1,6 @@ # Privacy Policy — SecureShell Go -**Effective date:** 14 November 2026 +**Effective date:** 16 November 2026 **Applies to:** SecureShell Go 1.5 and later, published by Dhiva Labs, on Android (Google Play, `com.dhivalabs.secure_shell_go`), Windows (Microsoft Store and the `.zip` builds on GitHub) and Linux (Snap Store, the Launchpad diff --git a/docs/privacy-policy/index.html b/docs/privacy-policy/index.html index 801fd95..d51062e 100644 --- a/docs/privacy-policy/index.html +++ b/docs/privacy-policy/index.html @@ -99,7 +99,7 @@

Privacy Policy — SecureShell Go

- Effective date: 14 November 2026
+ Effective date: 16 November 2026
Applies to: SecureShell Go 1.5 and later, published by Dhiva Labs, on Android (Google Play, com.dhivalabs.secure_shell_go), Windows (Microsoft Store and the .zip builds on GitHub) and Linux (Snap Store, the Launchpad PPA and the .tar.gz builds on GitHub), and to the unsigned macOS build on GitHub.

diff --git a/lib/services/bridge/bridge_tools.dart b/lib/services/bridge/bridge_tools.dart index d9a2cb4..bee3883 100644 --- a/lib/services/bridge/bridge_tools.dart +++ b/lib/services/bridge/bridge_tools.dart @@ -26,8 +26,11 @@ import 'bridge_tool_types.dart'; /// The commands the read tools run, separate from execution so the quoting /// can be asserted character for character. Every value that comes from an -/// assistant reaches the shell only through [posixSingleQuote]; numbers are -/// validated ints before they get here. +/// assistant reaches a shell only through a quoting function: values inside +/// a template (parsed by `/bin/sh`) through [posixSingleQuote], and the +/// whole template on the login shell's command line through +/// [BridgeCommands.loginShellQuote]; numbers are validated ints before they +/// get here. class BridgeCommands { const BridgeCommands._(); @@ -64,9 +67,15 @@ class BridgeCommands { /// does not reliably stop a remote process that has no terminal. A TERM /// or HUP sent to the wrapper itself is passed on in the same way. /// - /// The outer command is one `sh -c` with single-quoted arguments, which - /// every login shell parses the same way; the template reaches the inner - /// shell as `$1`, quoted once. + /// Two layers, two parsers. The OUTER command line returned here is parsed + /// by the account's LOGIN shell (sh, bash, zsh, fish, ...), so the template + /// reaches it through [loginShellQuote]. The wrapper script is fixed text + /// with no backslash, and runs under `sh -c`. The template itself (built + /// by [journal], [tailFile], [findByName] and the other command classes) + /// reaches `/bin/sh -c "$1"` as plain data and is parsed by `/bin/sh` + /// alone, so the values quoted INSIDE a template use [posixSingleQuote], + /// which is exact for `/bin/sh`. Never let a login shell parse a + /// [posixSingleQuote]d value: under fish a backslash is special there. static String supervised(String command) { const wrapper = r'''exec 3<&0 t= @@ -91,7 +100,32 @@ s=$? kill $w 2>/dev/null exit $s'''; return 'sh -c ${posixSingleQuote(wrapper)} ssg-bridge ' - '${posixSingleQuote(command)}'; + '${loginShellQuote(command)}'; + } + + /// [value] as one word for any login shell's command line, not only the + /// POSIX ones. [posixSingleQuote] is exact for sh, bash and zsh, but fish + /// reads `\\` and `\'` inside single quotes as escapes, so a value with a + /// backslash comes out changed, and one ending in a backslash escapes its + /// closing quote. Here no backslash is ever inside single quotes: a quote + /// is `'\''` (a backslash outside any quotes) and a backslash is `'"\\"'` + /// (double quotes, where `\\` is one backslash in sh, bash, zsh and fish + /// alike). For a value with no backslash the result is exactly + /// [posixSingleQuote]'s. + static String loginShellQuote(String value) { + final out = StringBuffer("'"); + for (final unit in value.runes) { + final c = String.fromCharCode(unit); + if (c == "'") { + out.write(r"'\''"); + } else if (c == r'\') { + out.write(r"""'"\\"'"""); + } else { + out.write(c); + } + } + out.write("'"); + return out.toString(); } /// Seconds `search_files` gives `find` when the server has `timeout`. diff --git a/packaging/flatpak/com.dhivalabs.secure_shell_go.metainfo.xml b/packaging/flatpak/com.dhivalabs.secure_shell_go.metainfo.xml index eac9613..3ce8088 100644 --- a/packaging/flatpak/com.dhivalabs.secure_shell_go.metainfo.xml +++ b/packaging/flatpak/com.dhivalabs.secure_shell_go.metainfo.xml @@ -31,7 +31,7 @@ - + diff --git a/store/play-data-safety.md b/store/play-data-safety.md index 800ad7f..70fb97d 100644 --- a/store/play-data-safety.md +++ b/store/play-data-safety.md @@ -2,7 +2,7 @@ Answers for Play Console → App content → Data safety, question by question, with the reasoning and the code behind each one. They match -`docs/privacy-policy.md` (effective 14 November 2026), so the form and the +`docs/privacy-policy.md` (effective 16 November 2026), so the form and the policy say the same thing. Definitions are Google's, from the Play Console Help article "Provide information for Google Play's Data safety section": diff --git a/test/bridge_shell_quoting_test.dart b/test/bridge_shell_quoting_test.dart new file mode 100644 index 0000000..3234db9 --- /dev/null +++ b/test/bridge_shell_quoting_test.dart @@ -0,0 +1,339 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:secure_shell_go/services/bridge/bridge_tools.dart'; +import 'package:secure_shell_go/services/log_tail.dart'; +import 'package:secure_shell_go/services/shell_quote.dart'; + +import 'support/bridge_fakes.dart'; +import 'support/bridge_temp_dir.dart'; + +/// Which shell parses which layer of a bridge command: +/// - the OUTER line `sh -c '' ssg-bridge '