Repository navigation
c71ad6c
Pre-releasefix(pelorus): Serve the API under /api/pelorus and refuse its writes to other sites
In secure mode the gate binds a session token to the routes under /api/
alone, and Pelorus served its API under /pelorus/api/, so with Basic auth
off a request carrying no credential reached every Pelorus handler with no
ceiling, which the handlers take for a controller: the desktop read, input
injected, and, with commands enabled, the shell tool run as the session
user. The API now sits under /api/pelorus, nested under one prefix, and
answers to the session token as every other API route does: no token is
refused, a viewer token or a Basic login without a token is a viewer and
refused by the handlers, a controller token or the master token passes.
Every Pelorus request but a read is refused to another site's page on any
server, whatever credential it carries, by its Origin or, where it names
none, by Sec-Fetch-Site: such a page can post a tool call as plain text
riding a browser's cached Basic login, and the handlers parse the body
whatever its type.
The dashboard calls the new path and sends the page's session token as a
Bearer header where it holds one. The pop-out page is opened on the page's
own origin carrying that token as the page got it, in the query or the
fragment, since the session cookie may not reach a window of its own; the
cookie, scoped to /api/, reaches the API where the page has no token.
External callers of /pelorus/api move to /api/pelorus.