Skip to content

[Bug] OAuth CLIENT_ID obfuscated with Base64 — security theatre, creates false impression of secrecy (B-01) #96490

Description

@riazrahaman

Summary

The Anthropic/Claude.ai OAuth client ID is stored as a Base64-encoded string rather than a plain constant. This creates a false impression that the value is sensitive when it is not — OAuth client IDs are public by design.

Location

src/llm/utils/oauth/anthropic.ts:46-47

const decode = (s: string) => atob(s);
const CLIENT_ID = decode("OWQxYzI1MGEtZTYxYi00NGQ5LTg4ZWQtNTk0NGQxOTYyZjVl");
// Decodes to: 9d1c250a-e61b-44d9-88ed-5944d1962f5e

Problem

  • atob() is not encryption — the value is trivially decoded by anyone reading the source
  • The obfuscation pattern implies the value is sensitive, which may lead future maintainers to treat it as a secret (e.g. rotating it unnecessarily, or adding it to secret scanning rules)
  • The OAuth client ID is sent in cleartext to https://claude.ai/oauth/authorize on every auth flow — it is already public
  • This adds unnecessary indirection and a runtime dependency on atob which is not available in all environments

Reproduction

node -e "console.log(atob('OWQxYzI1MGEtZTYxYi00NGQ5LTg4ZWQtNTk0NGQxOTYyZjVl'))"
# => 9d1c250a-e61b-44d9-88ed-5944d1962f5e

Fix

Replace with a plain string constant:

// Public OAuth client ID registered with claude.ai — not a secret.
const CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e";

Remove the decode helper function entirely.


Reported via automated codebase security review — github.com/openclaw/openclaw

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automationsecuritySecurity documentation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions