Replies: 2 comments
|
Confirmed against the pinned rc.7 source: this is a second UUID carrier, not a contradiction of the generic Connection regression test. |
|
Verified at rc.8 ( Browser-exposed (affected, need the
Node-only (NOT exposed, no change needed):
So the exposure surface is exactly the two sites you named, and your override is the right shape (the base One hardening suggestion beyond the two fixes: the split is currently implicit — Also seconding denial123789's boundary note: the UUID fallback makes LAN plain-HTTP functional, it does not make it safe — the operator guidance (localhost/SSH-forward or authenticated HTTPS) stays the real answer for an exposed agent shell. |
Uh oh!
There was an error while loading. Please reload this page.
Environment: DSH
0.1.0-rc.5, web UI served over plain HTTP on a LAN IP hostname (e.g.http://<lan-ip>:3080).Symptom: Opening the workspace directory picker (Add workspace) fails with
crypto.randomUUID is not a functionand cannot list directories. Any typed RPC throughWebApiClient—host.listDirectory,host.pickDirectory,workspace.create— fails the same way.Why:
crypto.randomUUIDis a secure-context-only Web API; browsers expose it only on HTTPS or loopback origins. Over plain HTTP on a non-loopback IP,window.isSecureContext === falseandcrypto.randomUUIDisundefined.AbstractApiClient.mintRpcId()inpackages/host/apiproxy/src/fetch/client.tscalls it directly, so every unary call mints its rpcId there and throws on such an origin.The generic RPC path (
packages/client/connection/src/client/rpc.ts) is already safe — it usesrandomUuid()fromrandom-uuid.ts, an RFC 4122 v4 UUID built oncrypto.getRandomValues, which browsers do expose on insecure origins. Only the typed carrier misses it.Proposed fix (one-liner):
WebApiClient(the browser subclass,packages/client/connection/src/client/web-api-client.ts) should override:Also worth hardening while touching this:
browserDraftAttachmentinpackages/client/ui-conversation/src/client/service.tsusescrypto.randomUUID()for draft attachment ids — same failure on such an origin.I verified the fix locally: the picker browses and selects a workspace over plain-HTTP-on-IP with zero console errors, with the existing test suite passing. Happy to adapt to whatever the team prefers once external PRs open up.
All reactions