-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Severity: CRITICAL
File: /root/spawn/packages/cli/src/digitalocean/digitalocean.ts
Lines: 71-72
Description:
DigitalOcean OAuth client credentials (client_id and client_secret) are hardcoded in the source code at lines 71-72:
const DO_CLIENT_ID = "c82b64ac5f9cd4d03b686bebf17546c603b9c368a296a8c4c0718b1f405e4bdc";
const DO_CLIENT_SECRET = "8083ef0317481d802d15b68f1c0b545b726720dbf52d00d17f649cc794efdfd9";While the comment on lines 45-70 explains this is intentional and follows patterns from other CLI tools (gh, doctl, gcloud, az), this is still a publicly disclosed secret that can be extracted by any user.
Risk:
- OAuth app impersonation — anyone can use these credentials to create their own OAuth flows impersonating the official spawn CLI
- Phishing attacks — malicious actors could clone the OAuth flow and trick users into authorizing a fake app
- Rate limit abuse — the shared client_id can be used to exhaust API quotas, affecting all users
- Revocation impact — if DigitalOcean revokes these credentials due to abuse, all spawn users lose DigitalOcean OAuth functionality
Recommendation:
The comment mentions monitoring for PKCE support (TODO #2041). This should be prioritized:
- Immediate: Monitor DigitalOcean OAuth announcements for PKCE support (check monthly)
- Short-term: Add PKCE implementation as soon as DigitalOcean supports it
- Long-term: Consider per-user OAuth app registration (users provide their own client credentials)
- Mitigation: Document that users should inspect OAuth consent screens carefully and only authorize the official spawn application
Note: The current implementation is noted as following industry patterns (gh CLI, doctl, gcloud, az all do this), but it's still a disclosed secret that warrants monitoring and eventual migration to PKCE.
-- security/code-scanner