molecule-core/workspace-server
Hongming Wang df2cf935d3 fix(handlers): validate path/auth BEFORE docker availability checks
Three traversal / cross-workspace rejection tests on staging were
masked by premature "docker not available" early returns:

1. deleteViaEphemeral — nil-docker check fired BEFORE path validation;
   malicious paths got "docker not available" (wrong code path) instead
   of "path not allowed". Reversed the order + added "path not allowed:"
   prefix to rejection messages.

2. copyFilesToContainer — split the traversal classifier into:
   - absolute path → "unsafe file path in archive"
   - literal "../" prefix → "unsafe file path in archive" (classic)
   - URL-encoded / mid-path traversal → "path escapes destination"
   Added nil-docker guard AFTER validation so legitimate inputs error
   cleanly instead of panicking on nil docker.

3. HandleConnect KI-005 — test used outdated table name
   "workspace_tokens"; ValidateAnyToken uses "workspace_auth_tokens"
   since #1210. Updated the mock. Added best-effort last_used_at
   UPDATE expectation that fires after successful token validation.

Brings the handlers package from 3 failing tests to 0. All 20 Go
packages green on go test -race ./... locally.
2026-04-23 09:31:54 -07:00
..
cmd/server fix(go): replace $1 literal with resp.Body.Close() in 7 files (#1247) 2026-04-21 03:18:21 +00:00
internal fix(handlers): validate path/auth BEFORE docker availability checks 2026-04-23 09:31:54 -07:00
migrations fix(review): address code review blockers on tool-trace + instructions 2026-04-22 16:18:06 -07:00
pkg/provisionhook fix(docker): fix plugin go.mod replace for TokenProvider interface (#960) 2026-04-20 13:42:53 -07:00
.ci-force chore: force Platform(Go) CI run on main — validate go vet clean 2026-04-21 15:43:19 +00:00
.gitignore
Dockerfile chore: extract ContextMenu Zustand fix + a2a_proxy local-docker SSRF bypass + workspace-server Dockerfile GID entrypoint 2026-04-22 20:00:16 -07:00
Dockerfile.tenant feat(terminal): remote path via aws ec2-instance-connect + pty 2026-04-21 18:13:29 -07:00
entrypoint-tenant.sh fix(security): add USER directive before ENTRYPOINT in all tenant images (#1155) 2026-04-20 23:51:33 +00:00
go.mod Merge main into staging - resolving 1,388 commit divergence for PR #1573 2026-04-22 13:54:53 +00:00
go.sum feat(terminal): remote path via aws ec2-instance-connect + pty 2026-04-21 18:13:29 -07:00