Repository navigation
Proposal: optional read containment for workspace-files (Remote reads outside the workspace) #7890
JanvanHout
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Version: observed on 0.1.7-rc.1; the same README text is on master (0.1.7-rc.2).
Current behaviour (documented):
@deepseek-ai/dsh-api-workspace-filesREADME, "Addressing and paths": "the service does not impose workspace containment on file reads".read,readBytes,statand filechangesaccept absolute paths, and relative paths are resolved from the workspace root. So any Web client holding the auth cookie can page through any file the Host process can read, for example/proc/self/environ, the launch token,$DSH_HOME/sessions/**, or.credentials.yaml.sandbox-policyread-onlyrestricts writes but not these reads. Directorylist/changesare already workspace-scoped.Why it matters: this is fine for the single-user loopback model. But
dsh webis also run behind a reverse proxy, over SSH forwarding, or as a shared instance. There, the file preview API turns into "read anything the Host process can read, including the Host's environment variables".ui-deliverablesinjectsworkspaceFilesas a required service, so it cannot be disabled on its own. Operators must choose between losing deliverables and exposing the Host filesystem.Proposal:
workspace-files, e.g.containment: 'workspace' | 'none', that applies the directory-listing rule (resolved path must remain inside the Session workspace root, symlinks resolved) toread/readBytes/stat/filechangesandbaseFile. Defaultnonekeeps today's behaviour;dsh web --host <non-loopback>could default toworkspace.readRoots: string[]), so deliverables outside the workspace keep working.workspaceFilesoptional inui-deliverables, so deployments can disable the service without breaking plugin activation (today the entry stayspending (waiting for service: workspaceFiles)).A related question:
session-referencestates it "assumes its host is authorized to read every session". A note inSAFETY.mdlisting the services that assume a single trusted user (workspace-files, session-reference, session-log-download, terminal, plugin-manager) would help anyone running a shared instance.All reactions