Skip to content

The agent that grows with you

docs(webapp): say that on Windows nothing checks who spends a launch link

emozillabf8e96e233a1
diff --git a/hermes_cli/web_routers/webapp.py b/hermes_cli/web_routers/webapp.py
index d381ceec498..41dc4021dd0 100644
--- a/hermes_cli/web_routers/webapp.py
+++ b/hermes_cli/web_routers/webapp.py
@@ -130,14 +130,17 @@ def _loopback_peer_uid(client: tuple[str, int], server: tuple[str, int]) -> int
def _peer_is_server_user(request: Request, platform: str = sys.platform) -> bool:
- """Whether this request's connection belongs to the OS user running the server.
-
- Linux authenticates the connection owner. Windows needs no check: a process's command line,
- where the launch ticket travels, is readable only by its own user, SYSTEM and elevated
- administrators. Elsewhere (macOS, the BSDs) every local user can read the launcher's argv
- and nothing here identifies the connection's owner, so an argv-carried launch ticket cannot
- be redeemed. Authenticated child-window tickets and the launch tickets ``hermes webapp`` prints for
- the user to open by hand (``mint_printed_launch_ticket``) do not use this launcher channel.
+ """Whether a launch ticket that crossed a browser launcher's argv may be spent over this
+ request's connection.
+
+ Linux checks that the connection belongs to the OS user running the server. Windows checks
+ nothing and always says yes: the protection there is that the ticket travels only in the
+ launcher's command line, which only its own user, SYSTEM and elevated administrators can read.
+ Elsewhere (macOS, the BSDs) every local user can read the launcher's argv and nothing here
+ identifies the connection's owner, so an argv-carried launch ticket cannot be redeemed; WSL
+ never mints one. Authenticated child-window tickets and the launch tickets ``hermes webapp``
+ prints for the user to open by hand (``mint_printed_launch_ticket``) do not use this launcher
+ channel.
"""
if platform == "win32":
return True
diff --git a/hermes_cli/webapp_launcher.py b/hermes_cli/webapp_launcher.py
index 46b12a2d230..023a6028b2b 100644
--- a/hermes_cli/webapp_launcher.py
+++ b/hermes_cli/webapp_launcher.py
@@ -3,8 +3,10 @@
The gateway serves the Webapp on its own listener when its home's config sets ``webapp.enabled``
(``gateway.webapp_listener``). This command builds the bundle when it is stale, starts the gateway that
serves the current profile, asks it for a one-use launch link over the control socket (same OS user
-only) and opens that link, so the credential appears in no argv, output or link. On macOS, the BSDs and
-WSL, where nothing checks who redeems the link, it prints the one-use link for the user to open instead.
+only) and opens that link, so the credential appears in no argv, output or link. On Linux the gateway
+checks that the browser's connection is the user's; on Windows nothing checks it, and the link travels
+only in the browser launcher's command line, which other standard users cannot read. On macOS, the BSDs
+and WSL neither holds, so it prints the one-use link for the user to open instead.
``--status`` and ``--sign-out`` talk to a running gateway and never start one.
"""
from __future__ import annotations
diff --git a/website/docs/reference/cli-commands.md b/website/docs/reference/cli-commands.md
index 4bf80adfc97..b9d0edff7db 100644
--- a/website/docs/reference/cli-commands.md
+++ b/website/docs/reference/cli-commands.md
@@ -1937,8 +1937,10 @@ use. See [Desktop App → Use the Desktop workspace from a browser](../user-guid
The link is valid for 60 seconds and works once; the browser exchanges it for the sign-in it keeps in
that tab. Only your own OS user can get a link: the gateway answers this command over its private
-control socket. On macOS, the BSDs and WSL, where a one-use link cannot be checked against your OS
-user, the command prints the link for you to open and never passes it to a browser launcher. Until it is
+control socket. On Linux the gateway checks that the browser's connection belongs to your OS user; on
+Windows it checks nothing, and the link travels only in the browser launcher's command line, which other
+standard users cannot read. On macOS, the BSDs and WSL neither holds, so the command prints the link
+for you to open and never passes it to a browser launcher. Until it is
used it signs a browser in as you, so keep it private.
For a named profile served by the default gateway (`hermes -p work webapp`), the Webapp opens on that
diff --git a/website/docs/user-guide/desktop.md b/website/docs/user-guide/desktop.md
index 00936e91ec0..8c3fd3efab2 100644
--- a/website/docs/user-guide/desktop.md
+++ b/website/docs/user-guide/desktop.md
@@ -53,10 +53,11 @@ serves the CLI, the native Desktop and messaging, so every surface sees one conv
keeps in that tab, so reloading keeps you signed in, and so does a gateway restart. A fresh tab or a
bare URL shows instructions instead of access: run `hermes webapp` again for a new link. **New
Window**, profile windows and session pop-outs hand the sign-in over with their own one-use link. On
-macOS, the BSDs and WSL (where the Windows browser reaches the gateway through WSL's relay), Hermes
-cannot check which OS user's browser opens the link, so the command prints the one-use link for you
-to open instead of opening a browser; until it is used it signs a browser in as you, so keep it
-private. `hermes webapp --sign-out` signs out every
+Linux the gateway checks that the browser's connection belongs to your OS user; on Windows the link
+travels only in the browser launcher's command line, which other standard users cannot read. On macOS,
+the BSDs and WSL (where the Windows browser reaches the gateway through WSL's relay) neither holds, so
+the command prints the one-use link for you to open instead of opening a browser; until it is used it
+signs a browser in as you, so keep it private. `hermes webapp --sign-out` signs out every
tab at once: their open connections close, Bot Desktop viewers included, and each shows the sign-in
instructions. Behind the sign-in gate (below) it also signs out every browser that signed in with a
dashboard account; each must sign in again. The account tokens such a login keeps in its cookies work