mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-09 22:48:57 +02:00
feat(redact): block Google OAuth client secrets and Telegram bot tokens at HIGH
GOCSPX-prefixed client secrets and <bot_id>:<35-char> Telegram tokens are never-publishable credential shapes with unambiguous formats — both now block at HIGH like the other live-format credentials. Contributed by @francis-eye (PR #2357). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
d410142c2f
commit
69cc39c625
@@ -374,6 +374,25 @@ export const PATTERNS: RedactPattern[] = [
|
||||
nearRegex: /\bAC[a-f0-9]{32}\b/,
|
||||
nearWindow: 200,
|
||||
},
|
||||
{
|
||||
id: "google.oauth_client_secret",
|
||||
tier: "HIGH",
|
||||
category: "secret",
|
||||
// Distinct from google.api_key (MEDIUM): an AIza key is often a public
|
||||
// client key, but a GOCSPX- client secret is never publishable — leaking
|
||||
// it lets anyone impersonate the OAuth app's token exchange.
|
||||
description: "Google OAuth client secret (GOCSPX-…)",
|
||||
regex: /\b(GOCSPX-[A-Za-z0-9_-]{20,40})(?![A-Za-z0-9_-])/,
|
||||
validate: (span) => !isPlaceholderSpan(span),
|
||||
},
|
||||
{
|
||||
id: "telegram.bot_token",
|
||||
tier: "HIGH",
|
||||
category: "secret",
|
||||
description: "Telegram bot token (<bot-id>:AA…)",
|
||||
regex: /\b([0-9]{6,16}:A[A-Za-z0-9_-]{34})(?![A-Za-z0-9_-])/,
|
||||
validate: (span) => !isPlaceholderSpan(span),
|
||||
},
|
||||
{
|
||||
id: "pem.private_key",
|
||||
tier: "HIGH",
|
||||
|
||||
Reference in New Issue
Block a user