Skip to content

feat(enrichment): detect Resend API keys and Mapbox secret tokens in secret-scan#3266

Closed
bohdansolovie wants to merge 1 commit into
JSONbored:mainfrom
bohdansolovie:feat/secret-scan-resend-mapbox
Closed

feat(enrichment): detect Resend API keys and Mapbox secret tokens in secret-scan#3266
bohdansolovie wants to merge 1 commit into
JSONbored:mainfrom
bohdansolovie:feat/secret-scan-resend-mapbox

Conversation

@bohdansolovie

Copy link
Copy Markdown
Contributor

Summary

  • Add high-confidence secret-scan rules for Resend API keys (re_ + base62) and Mapbox secret access tokens (sk.eyJ JWT-shaped tokens).
  • Mapbox rule is distinct from Stripe sk_live_ / sk_test_ prefixes via the sk.eyJ anchor.

Motivation

Resend and Mapbox credentials are commonly leaked in env files and deployment configs. The secret-scan analyzer already covers many email/maps SaaS tokens but missed these formats.

Test plan

  • Resend API key — positive match and truncated negative
  • Mapbox secret token — positive match, not classified as Stripe secret key
  • Fragment-based fixtures (no contiguous fake secrets in committed source)
  • Full secret-scan.test.ts suite passes (59 tests)
  • npm run build in review-enrichment/

Made with Cursor

…secret-scan

Add high-confidence patterns for Resend `re_` keys and Mapbox `sk.eyJ` secret
tokens with fragment-based fixtures, truncation negatives, and Stripe parity.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bohdansolovie
bohdansolovie requested a review from JSONbored as a code owner July 4, 2026 23:53
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 4, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 4, 2026
@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-04 23:52:12 UTC

2 files · 1 AI reviewer · 1 blocker · readiness 73/100 · CI green · clean

🛑 Suggested Action - Reject/Close

  • AI reviewers agree on a likely critical defect: review-enrichment/src/analyzers/secret-scan.ts:197: The Mapbox rule requires a later `.` via `\.[A-Za-z0-9_-]{10,}` and the test fabricates `sk.eyJ... ....`, so real `sk.eyJ...` Mapbox access tokens without that second dot will not be reported
  • change the rule/test to the actual token shape, e.g. `re: /\bsk\.eyJ[A-Za-z0-9_-]{24,}(?![A-Za-z0-9_-])/`, or explain with a real Mapbox fixture why the extra segment is required. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
The Resend detector is straightforward and covered by the new positive/truncated tests. The Mapbox detector is wired into the rule list, but the regex and tests model a two-segment token after `sk.` instead of the real Mapbox access-token shape, so the claimed coverage misses the production case it is meant to catch.

Blockers

  • review-enrichment/src/analyzers/secret-scan.ts:197: The Mapbox rule requires a later `.` via `\.[A-Za-z0-9_-]{10,}` and the test fabricates `sk.eyJ... ....`, so real `sk.eyJ...` Mapbox access tokens without that second dot will not be reported; change the rule/test to the actual token shape, e.g. `re: /\bsk\.eyJ[A-Za-z0-9_-]{24,}(?![A-Za-z0-9_-])/`, or explain with a real Mapbox fixture why the extra segment is required.
Nits — 2 non-blocking
  • review-enrichment/test/secret-scan.test.ts:480: Add a positive Mapbox fixture assembled from fragments that matches the documented production token shape, not just the regex shape, so this cannot regress into another fabricated-path test.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.

Why this is blocked

  • review-enrichment/src/analyzers/secret-scan.ts:197: The Mapbox rule requires a later `.` via `\.[A-Za-z0-9_-]{10,}` and the test fabricates `sk.eyJ... ....`, so real `sk.eyJ...` Mapbox access tokens without that second dot will not be reported; change the rule/test to the actual token shape, e.g. `re: /\bsk\.eyJ[A-Za-z0-9_-]{24,}(?![A-Za-z0-9_-])/`, or explain with a real Mapbox fixture why the extra segment is required.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 182 registered-repo PR(s), 102 merged, 9 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bohdansolovie; Gittensor profile; 182 PR(s), 9 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: bohdansolovie
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 182 PR(s), 9 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (AI reviewers agree on a likely critical defect: review-enrichment/src/analyzers/secret-scan.ts:197: The Mapbox rule requires a later `.` via `\.[A-Za-z0-9_-]{10,}` and the test fabricates `sk.eyJ... ....`, so real `sk.eyJ...` Mapbox access tokens without that second dot will not be reported; change the rule/test to the actual token shape, e.g. `re: /\bsk\.eyJ[A-Za-z0-9_-]{24,}(?![A-Za-z0-9_-])/`, or explain with a real Mapbox fixture why the extra segment is required.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 4, 2026
bohdansolovie added a commit to bohdansolovie/gittensory that referenced this pull request Jul 4, 2026
…-scan

Use sk.eyJ + base64url body without a fabricated second dot segment per
Orb feedback on JSONbored#3266; add pk-token and truncation negatives.

Co-authored-by: Cursor <cursoragent@cursor.com>
loopover-orb Bot pushed a commit that referenced this pull request Jul 5, 2026
…secret-scan (#3267)

* feat(enrichment): detect Resend API keys and Mapbox secret tokens in secret-scan

Add high-confidence patterns for Resend `re_` keys and Mapbox `sk.eyJ` secret
tokens with fragment-based fixtures, truncation negatives, and Stripe parity.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(enrichment): match production Mapbox secret token shape in secret-scan

Use sk.eyJ + base64url body without a fabricated second dot segment per
Orb feedback on #3266; add pk-token and truncation negatives.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant