Skip to content

Conversation

@khaliqgant
Copy link
Collaborator

Fixes bd-critical-016: Workspace Daemon Auth - Unauthenticated Endpoints

The workspace daemon's CLI auth endpoints were exposed without authentication. In cloud mode, attackers could potentially:

  • Submit malicious codes to active auth sessions
  • Enumerate active sessions
  • DoS the PTY processes
  • Hijack OAuth flows mid-completion

Changes:

  • Add validateWorkspaceToken middleware to dashboard-server
  • Apply middleware to all /auth/cli/* endpoints
  • Skip auth in local mode (no WORKSPACE_TOKEN set)
  • Update cloud server onboarding.ts to send Authorization header
  • Add generateWorkspaceToken() helper matching provisioner logic
  • Store workspaceId in session for subsequent requests

The workspace token is an HMAC-SHA256 hash of the workspace ID, signed with the session secret. This matches the token generation in the provisioner.

🤖 Generated with Claude Code

Agent Relay and others added 2 commits January 5, 2026 18:27
Fixes bd-critical-016: Workspace Daemon Auth - Unauthenticated Endpoints

The workspace daemon's CLI auth endpoints were exposed without
authentication. In cloud mode, attackers could potentially:
- Submit malicious codes to active auth sessions
- Enumerate active sessions
- DoS the PTY processes
- Hijack OAuth flows mid-completion

Changes:
- Add validateWorkspaceToken middleware to dashboard-server
- Apply middleware to all /auth/cli/* endpoints
- Skip auth in local mode (no WORKSPACE_TOKEN set)
- Update cloud server onboarding.ts to send Authorization header
- Add generateWorkspaceToken() helper matching provisioner logic
- Store workspaceId in session for subsequent requests

The workspace token is an HMAC-SHA256 hash of the workspace ID,
signed with the session secret. This matches the token generation
in the provisioner.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants