Skip to content

security: DigitalOcean OAuth client_secret exposed in source code #2596

@louisgv

Description

@louisgv

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:

  1. OAuth app impersonation — anyone can use these credentials to create their own OAuth flows impersonating the official spawn CLI
  2. Phishing attacks — malicious actors could clone the OAuth flow and trick users into authorizing a fake app
  3. Rate limit abuse — the shared client_id can be used to exhaust API quotas, affecting all users
  4. 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:

  1. Immediate: Monitor DigitalOcean OAuth announcements for PKCE support (check monthly)
  2. Short-term: Add PKCE implementation as soon as DigitalOcean supports it
  3. Long-term: Consider per-user OAuth app registration (users provide their own client credentials)
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    safe-to-workSecurity triage: safe for automated processingwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions