fix(export): broaden SECRET_REGEX to cover Slack, Stripe, Discord, Google SA, future OR prefixes#3386
Open
fix(export): broaden SECRET_REGEX to cover Slack, Stripe, Discord, Google SA, future OR prefixes#3386
Conversation
…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>
Member
Author
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why: Closes known gaps in the
SECRET_REGEXthat 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 publicgh repo create --push.Fixes #3381
Changes
sk-or-v1-[a-f0-9]{20,}tosk-or-[a-zA-Z0-9_-]{20,}(covers v2+ prefixes and non-hex chars)xox[abp]-[0-9A-Za-z-]{10,}(bot/user/app tokens)sk_live_[A-Za-z0-9]{24,}(live secret keys)[A-Za-z0-9_-]{24}\.[A-Za-z0-9_-]{6}\.[A-Za-z0-9_-]{27,}(bot tokens)"type":\s*"service_account"(service account JSON blocks)Skipped generic
Authorization: Bearerpattern as too noisy for default mode (noted in issue as--strictonly).-- refactor/ux-engineer