Skip to content

fix(rotation): OAuth client ids are identifiers, never rotated (CLI 0.16.2) - #299

Merged
ralyodio merged 1 commit into
masterfrom
fix/oauth-client-id-not-rotatable
Nov 30, 2026
Merged

ralyodio merged 1 commit into
masterfrom
fix/oauth-client-id-not-rotatable

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

c0upons CoinPay sign-in broke with invalid_client: Invalid client_id.
c0upons--prod's COINPAY_CLIENT_ID held the same value as COINPAY_API_KEY,
and a rotation writes every vault:key with the value's fingerprint,
whatever the key is called. The 2026-11-22 coinpay-api-key run minted a new
cp_live_ key, wrote it into COINPAY_CLIENT_ID too, and saved the rotator
state as __ROTATE__COINPAY_CLIENT_ID (targets[0] was the client id), so the
plan showed the client id as provider/coinpay/automatic from then on.

  • New method identifier: every *_CLIENT_ID (COINPAY_CLIENT_ID,
    *_OAUTH_CLIENT_ID, GOOGLE_CLIENT_ID...) gets it from the catalog, never
    automatic, with the reason. A ROTATE entry claiming otherwise is
    ignored and reported in the plan with the command to reset it.
  • rotate-keys never writes a rotated value into a client id under another
    name (named in the result instead), records rotator state under the
    plan's own key, and skips a client id outright.
  • coinpay-api-key and coinpay-webhook-secret refuse a client id in
    preflight and mint without calling CoinPay.
  • rotation-set refuses random/provider/command/ssh-keygen for a client id.
  • Tests for each; docs/rotation.md.

🤖 Generated with Claude Code

….16.2)

c0upons CoinPay sign-in broke with `invalid_client: Invalid client_id`.
c0upons--prod's COINPAY_CLIENT_ID held the same value as COINPAY_API_KEY,
and a rotation writes every vault:key with the value's fingerprint,
whatever the key is called. The 2026-11-22 coinpay-api-key run minted a new
cp_live_ key, wrote it into COINPAY_CLIENT_ID too, and saved the rotator
state as __ROTATE__COINPAY_CLIENT_ID (targets[0] was the client id), so the
plan showed the client id as provider/coinpay/automatic from then on.

- New method `identifier`: every *_CLIENT_ID (COINPAY_CLIENT_ID,
  *_OAUTH_CLIENT_ID, GOOGLE_CLIENT_ID...) gets it from the catalog, never
  automatic, with the reason. A __ROTATE__ entry claiming otherwise is
  ignored and reported in the plan with the command to reset it.
- rotate-keys never writes a rotated value into a client id under another
  name (named in the result instead), records rotator state under the
  plan's own key, and skips a client id outright.
- coinpay-api-key and coinpay-webhook-secret refuse a client id in
  preflight and mint without calling CoinPay.
- rotation-set refuses random/provider/command/ssh-keygen for a client id.
- Tests for each; docs/rotation.md.

Co-authored-by: riotcoder <riotcoder@profullstack.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

24 finding(s) in the 11 file(s) this pull request changes.

MEDIUM: 14 | LOW: 10

Severity Rule Location
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:283
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:327
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:329
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:333
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:337
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:356
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:357
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:359
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:360
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:361
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:364
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:425
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:432
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:438
LOW secret-generic-api-key packages/cli/src/rotate-flow.test.ts:177
LOW secret-generic-credential packages/cli/src/rotate-flow.test.ts:184
LOW secret-generic-api-key packages/cli/src/rotate-flow.test.ts:198
LOW secret-generic-credential packages/cli/src/rotate-flow.test.ts:204
LOW secret-generic-credential packages/cli/src/rotate-flow.test.ts:220
LOW secret-generic-credential packages/cli/src/rotators.test.ts:54
LOW secret-generic-credential packages/cli/src/rotators.test.ts:77
LOW secret-generic-credential packages/cli/src/rotators.test.ts:253
LOW js-hardcoded-crypto-key packages/cli/src/rotators.test.ts:304
LOW secret-database-url packages/cli/src/rotators.test.ts:340
37 pre-existing finding(s) elsewhere in the repository — **HIGH**: 3 | **MEDIUM**: 17 | **LOW**: 17

Not introduced by this pull request.

Severity Rule Location
HIGH js-host-header-trust apps/commandboard-web/server.js:27
HIGH secret-generic-high-entropy apps/pwa/.env.example:11
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
MEDIUM gha-ssh-key-secret .github/workflows/deploy-dev2-app-logicsrc-com.yml:39
MEDIUM gha-ssh-key-secret .github/workflows/deploy-dev2-logicsrc-com.yml:39
MEDIUM js-unescaped-html-sink apps/commandboard-web/src/main.ts:19
MEDIUM sh-remote-script-execution apps/logicsrc-web/public/install.sh:71
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/app/[[...slug]]/page.tsx:59
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/app/layout.tsx:88
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/app/pricing/page.tsx:42
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/components/breadcrumbs.tsx:43
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/components/pit-footer.tsx:16
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/components/site-shell.tsx:36
MEDIUM js-unescaped-html-sink apps/pwa/public/keyring.js:51
MEDIUM sql-template-interpolation apps/pwa/src/routes/rotation.mjs:79
MEDIUM redos-nested-quantifier packages/opencontext/src/ids.ts:10
MEDIUM redos-nested-quantifier packages/opencontext/src/ids.ts:11
MEDIUM js-timing-unsafe-mac-compare packages/opencontext/src/validate.ts:208
MEDIUM redos-nested-quantifier packages/openerrand/src/browser.ts:34
MEDIUM redos-nested-quantifier packages/openontology/src/ids.ts:20

…and 17 more; the full set is in the SARIF artifact.

Snippets are redacted; ThreatCrush never prints matched credential material.

const team = await makeTeam({ "a--prod": { COINPAY_CLIENT_ID: SAME }, "b--prod": { RESEND_API_KEY: SAME } });
const fetch = (async (_url: any, init: any = {}) =>
(init.method ?? "GET") === "POST"
? new Response(JSON.stringify({ id: "new-id", token: "re_new_yyyyyyyyyyyyyyyy" }), { status: 201 })
@ralyodio
ralyodio merged commit 267973f into master Nov 30, 2026
4 checks passed
@ralyodio
ralyodio deleted the fix/oauth-client-id-not-rotatable branch November 30, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants