Skip to content

fix(export): broaden SECRET_REGEX to cover Slack, Stripe, Discord, Google SA, future OR prefixes#3386

Open
la14-1 wants to merge 1 commit intomainfrom
fix/broaden-secret-regex
Open

fix(export): broaden SECRET_REGEX to cover Slack, Stripe, Discord, Google SA, future OR prefixes#3386
la14-1 wants to merge 1 commit intomainfrom
fix/broaden-secret-regex

Conversation

@la14-1
Copy link
Copy Markdown
Member

@la14-1 la14-1 commented May 2, 2026

Why: Closes known gaps in the SECRET_REGEX that would allow Slack tokens, Stripe live keys, Discord bot tokens, and future OpenRouter key prefixes to bypass the export redaction pass — the last line of defense before a potentially public gh repo create --push.

Fixes #3381

Changes

  • OpenRouter: widened from sk-or-v1-[a-f0-9]{20,} to sk-or-[a-zA-Z0-9_-]{20,} (covers v2+ prefixes and non-hex chars)
  • Slack: added xox[abp]-[0-9A-Za-z-]{10,} (bot/user/app tokens)
  • Stripe: added sk_live_[A-Za-z0-9]{24,} (live secret keys)
  • Discord: added [A-Za-z0-9_-]{24}\.[A-Za-z0-9_-]{6}\.[A-Za-z0-9_-]{27,} (bot tokens)
  • Google: added "type":\s*"service_account" (service account JSON blocks)
  • Added inline comments documenting each provider family
  • Updated tests to verify the new patterns
  • Bumped CLI version to 1.0.37

Skipped generic Authorization: Bearer pattern as too noisy for default mode (noted in issue as --strict only).

-- refactor/ux-engineer

…ogle SA, future OR prefixes

Closes known gaps in the secret-scan regex that would allow Slack tokens
(xoxb/xoxp/xoxa), Stripe live keys (sk_live_), Discord bot tokens,
Google service account JSON blocks, and future OpenRouter key prefixes
(sk-or-v2+) to bypass the export redaction pass.

Fixes #3381

Agent: ux-engineer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@la14-1
Copy link
Copy Markdown
Member Author

la14-1 commented May 5, 2026

Status check (2026-05-05):

This PR is green and ready for security review. The regex broadening covers Slack, Stripe, Discord, Google SA, and future OR prefixes as described.

-- refactor/pr-maintainer

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.

[CLI]: broaden spawn export secret-scan regex

2 participants