Skip to content

feat(enrichment): detect fal.ai and Weights & Biases API keys in secret-scan - #3299

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

feat(enrichment): detect fal.ai and Weights & Biases API keys in secret-scan#3299
bohdansolovie wants to merge 1 commit into
JSONbored:mainfrom
bohdansolovie:feat/secret-scan-fal-wandb

Conversation

@bohdansolovie

Copy link
Copy Markdown
Contributor

Summary

  • Add fal_api_key rule for fal.ai keys (fal_sk_ prefix).
  • Add wandb_api_key rule for Weights & Biases v1 keys (wandb_v1_ + 77-char body).
  • Include positive, truncation, and hyphen/underscore continuation negative tests.

Test plan

  • npm run build && node --test test/secret-scan.test.ts in review-enrichment/ (76 passing)

Made with Cursor

…et-scan

Add high-confidence rules for fal_sk_ (fal.ai) and wandb_v1_ (77-char body)
with truncation and identifier-continuation regression tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bohdansolovie
bohdansolovie requested a review from JSONbored as a code owner July 5, 2026 01:12
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 5, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@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 5, 2026
@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Caution

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

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-05 01:13:42 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:273: the W&B regex uses `(?![A-Za-z0-9_])`, so `wandb_v1_${"a".repeat(77)}-suffix` is flagged as a key even though this PR explicitly claims hyphen continuation is rejected
  • change it to `re: /\bwandb_v1_[A-Za-z0-9_]{77}(?![A-Za-z0-9_-])/`, or explain why W&B should intentionally differ from the fal.ai and existing SaaS-token continuation guards. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
The change cleanly adds two new secret-scan rules and exercises the positive/truncated paths. The fal.ai rule follows the existing continuation-guard convention, but the W&B rule does not reject hyphen continuation even though the PR claims that behavior and the fal rule does it correctly. That leaves a reachable false-positive path in normal identifier/string continuations.

Blockers

  • review-enrichment/src/analyzers/secret-scan.ts:273: the W&B regex uses `(?![A-Za-z0-9_])`, so `wandb_v1_${"a".repeat(77)}-suffix` is flagged as a key even though this PR explicitly claims hyphen continuation is rejected; change it to `re: /\bwandb_v1_[A-Za-z0-9_]{77}(?![A-Za-z0-9_-])/`, or explain why W&B should intentionally differ from the fal.ai and existing SaaS-token continuation guards.
Nits — 5 non-blocking
  • review-enrichment/test/secret-scan.test.ts:704: add the missing W&B hyphen-continuation negative case so the test actually covers the behavior described in the PR summary: `scanPatch("src/config.ts", hunk([\`const wandb = "wandb_v1_${"a".repeat(77)}-suffix";\`])).some((f) => f.kind === "wandb_api_key")` should be `false`.
  • review-enrichment/test/secret-scan.test.ts:682: the new tests use literal `"a".repeat(...)` bodies while the surrounding file already has token-body helpers like `b62`; using the existing helper would keep the fixtures closer to the declared base62 shape and reduce repeated magic lengths.
  • review-enrichment/src/analyzers/secret-scan.ts:273: align the W&B lookahead with the fal.ai rule by rejecting `-` as a continuation character too.
  • review-enrichment/test/secret-scan.test.ts:704: add the W&B `-suffix` negative regression next to the existing `_suffix` and `X` checks.
  • 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:273: the W&B regex uses `(?![A-Za-z0-9_])`, so `wandb_v1_${"a".repeat(77)}-suffix` is flagged as a key even though this PR explicitly claims hyphen continuation is rejected; change it to `re: /\bwandb_v1_[A-Za-z0-9_]{77}(?![A-Za-z0-9_-])/`, or explain why W&B should intentionally differ from the fal.ai and existing SaaS-token continuation guards.
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: 216 registered-repo PR(s), 130 merged, 9 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bohdansolovie; Gittensor profile; 216 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: 216 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 5, 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:273: the W&B regex uses `(?![A-Za-z0-9_])`, so `wandb_v1_${"a".repeat(77)}-suffix` is flagged as a key even though this PR explicitly claims hyphen continuation is rejected; change it to `re: /\bwandb_v1_[A-Za-z0-9_]{77}(?![A-Za-z0-9_-])/`, or explain why W&B should intentionally differ from the fal.ai and existing SaaS-token continuation guards.). 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.

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