Repository navigation
Conversation
Same bug class as blitzcrieg1#483: OpenRouter keys (sk-or-v1-...) break the generic sk-[a-zA-Z0-9]{20,} rule's alnum-only run at the hyphen after "sk", and Groq keys (gsk_...) don't match any existing prefix at all. Both leaked silently with zero findings. Adds dedicated rules for each, next to the other provider-specific sk- exceptions. Co-Authored-By: Claude Sonnet 5 <[email protected]>
blitzcrieg1
reviewed
Nov 26, 2026
blitzcrieg1
left a comment
Owner
There was a problem hiding this comment.
Thanks for adding coverage for these two providers. The GitHub checks are green. Before merge, could you tighten the token matching and add capture-scrubbing tests?
- The OpenRouter pattern accepts truncated suffixes and letters outside hex. TruffleHog documents a 64-hex suffix in its detector. Please match the supported format with a full-token boundary and add truncated and non-hex near-misses. TruffleHog detector
- For Groq, please cite the key shapes this rule intends to support and test a realistic near-miss. The current minimum length by itself leaves the rule broad.
- These formats are missing from the separate hook and orchestrator scrubbers. Please add synthetic coverage showing that both paths remove the entire value when argument or command capture is enabled.
This was referenced Nov 26, 2026
Owner
blitzcrieg1
added a commit
that referenced
this pull request
Nov 26, 2026
…mbined #488 #489) (#495) * feat(dlp): detect OpenRouter and Groq API keys Same bug class as #483: OpenRouter keys (sk-or-v1-...) break the generic sk-[a-zA-Z0-9]{20,} rule's alnum-only run at the hyphen after "sk", and Groq keys (gsk_...) don't match any existing prefix at all. Both leaked silently with zero findings. Adds dedicated rules for each, next to the other provider-specific sk- exceptions. Co-Authored-By: Claude Sonnet 5 <[email protected]> * feat(dlp): detect Replicate, Perplexity and xAI API keys * docs: changelog entry for the five provider key DLP rules (#488, #489) Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <[email protected]> --------- Co-authored-by: bewfordq <[email protected]> Co-authored-by: Claude Sonnet 5 <[email protected]> Co-authored-by: Mistral Vibe <[email protected]>
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.
Refs #454.
Same bug class as #478/#483: two more providers whose keys no rule matches.
sk-or-v1-<hex>. The hyphen afterskbreaksgeneric_provider_api_key'salphanumeric run at the fifth character, so a leaked OpenRouter key produces no finding.
gsk_, which thesk-rules never match at all (thegbreaks the word boundary).Change
openrouter_api_keyrule:(?i)\bsk-or-v1-[a-zA-Z0-9]{16,}, credentials/critical.groq_api_keyrule:(?i)\bgsk_[a-zA-Z0-9]{20,}, credentials/critical.openai_project_api_keytests from dlp: OpenAI project/service-account keys (sk-proj-, sk-svcacct-, sk-admin-) have no DLP rule #478.Verification
pytest is not installed in this environment, so the manifest was loaded and the patterns compiled directly:
both new rules match their sample keys, both reject short lookalikes, and the legacy
sk-rule does notmatch the OpenRouter sample - which is the gap being closed.