-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
in-progressIssue is being actively worked onIssue is being actively worked onsafe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processingsecuritySecurity vulnerabilities and concernsSecurity vulnerabilities and concerns
Description
Severity
CRITICAL
Location
packages/cli/src/digitalocean/digitalocean.ts lines 91-93
Description
The DigitalOcean OAuth client secret is hardcoded in the source code:
const DO_CLIENT_SECRET =
process.env["DO_CLIENT_SECRET"] ?? "8083ef0317481d802d15b68f1c0b545b726720dbf52d00d17f649cc794efdfd9";While the inline comment explains this is similar to other CLI tools (gh, doctl, gcloud, az) and notes that "any secret shipped in source code or a binary is extractable and provides zero confidentiality", having the secret in plaintext makes it trivially easy for attackers to extract.
Risk
An attacker with this secret could potentially:
- Impersonate the spawn CLI application during OAuth flows
- Create phishing attacks that appear to use legitimate spawn OAuth credentials
- Monitor or intercept spawn's OAuth flows more easily
Impact
All users authenticating to DigitalOcean via spawn's OAuth flow.
Recommendation
- Consider using PKCE (Proof Key for Code Exchange) without a client secret if DigitalOcean supports it
- If PKCE is not available, document this as a known limitation of DigitalOcean's OAuth implementation
- Add monitoring/rate limiting on the OAuth application to detect abuse
- Consider rotating the secret periodically and using a build-time secret injection mechanism
Context
The code includes a TODO comment about migrating to PKCE when DigitalOcean adds support (lines 80-90), which would eliminate the need for a client secret entirely.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in-progressIssue is being actively worked onIssue is being actively worked onsafe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processingsecuritySecurity vulnerabilities and concernsSecurity vulnerabilities and concerns