diff --git a/src/servers/api/plugin-ws/target.ts b/src/servers/api/plugin-ws/target.ts index 39071d97..bdba0036 100644 --- a/src/servers/api/plugin-ws/target.ts +++ b/src/servers/api/plugin-ws/target.ts @@ -9,13 +9,13 @@ import { snapshotPlugins } from '@@/plugins/mount'; line-oriented sidecar without knowing which is which. The moment this returned a scheme or a path, the relay would have to care what it was carrying. - Two forms, because two things genuinely differ: + The target is always a SIDECAR. A fixed-port form was written and removed the same day: nothing stops a + manifest naming a port it does not own, so `{ port: 5432 }` plus a grant would be a raw TCP relay onto + Postgres for anyone that plugin reaches. Verifying the host is loopback is not verifying the port belongs + to the plugin, and only the second question matters. - { port: 5900 } a fixed port a plugin's own service listens on — `x11vnc` for a desktop, or - anything the plugin starts itself and knows the number of in advance. - { sidecar: 'name' } resolved at connect time, because a sidecar binds an EPHEMERAL port and announces - it. A manifest cannot know that number, which is why the indirection exists rather - than being a convenience. + A sidecar's port is different in kind, not degree: the platform watched it arrive at registration, so the + association is observed rather than asserted. **Host is always loopback and is not configurable.** A plugin socket that could name an arbitrary host would be a request-forgery primitive handed to every plugin author and reachable by anyone the plugin is @@ -32,8 +32,6 @@ export async function pluginWsTargetFor(appName: string): Promise