fix(security): add workspace token auth to CLI auth endpoints#62
Closed
khaliqgant wants to merge 2 commits intomainfrom
Closed
fix(security): add workspace token auth to CLI auth endpoints#62khaliqgant wants to merge 2 commits intomainfrom
khaliqgant wants to merge 2 commits intomainfrom
Conversation
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 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 My Senior Dev — Analysis Complete👤 For @khaliqgant⚡ 8th PR this month View your contributor analytics → 📊 4 files reviewed • 2 high risk • 5 need attention 🚨 High Risk:
🚀 Open Interactive Review →The full interface unlocks features not available in GitHub:
💬 Chat here: 📖 View all 12 personas & slash commandsYou can interact with me by mentioning In PR comments or on any line of code:
Slash commands:
AI Personas (mention to get their perspective):
For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Changes:
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