Skip to content

feat(enrichment): detect Statsig server secret and Paddle API keys - #3344

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

feat(enrichment): detect Statsig server secret and Paddle API keys#3344
bohdansolovie wants to merge 1 commit into
JSONbored:mainfrom
bohdansolovie:feat/secret-scan-statsig-paddle

Conversation

@bohdansolovie

Copy link
Copy Markdown
Contributor

Summary

  • Add statsig_server_secret_key rule for Statsig secret- server SDK keys
  • Add paddle_api_key rule for Paddle pdl_(live|sdbx)_apikey_ fixed-format API keys
  • Include positive, truncation, and identifier-continuation negative tests

Test plan

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

Made with Cursor

Add high-confidence secret-scan rules for Statsig secret- server keys and
Paddle pdl_(live|sdbx)_apikey_ tokens, with truncation and identifier-
continuation negative tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bohdansolovie
bohdansolovie requested a review from JSONbored as a code owner July 5, 2026 04:20
@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 5, 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 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 04:20:55 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:403 declares the first Paddle key segment as base62 but matches only `[a-z0-9]{26}`, so a valid `pdl_live_apikey_` key with an uppercase character in that 26-character segment is silently missed
  • change it to `[A-Za-z0-9]{26}` or explain why this segment is actually lowercase-only despite the comment and PR description. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
This PR adds two high-confidence secret-scan rules plus positive and boundary tests for the new formats. The Statsig rule is consistent with the stated prefix/minimum-body behavior, but the Paddle rule does not match its own declared base62 format for the first fixed segment, so it will miss valid-looking keys that contain uppercase characters there. The tests cover truncation and continuation boundaries, but they only exercise the lowercase Paddle happy path.

Blockers

  • review-enrichment/src/analyzers/secret-scan.ts:403 declares the first Paddle key segment as base62 but matches only `[a-z0-9]{26}`, so a valid `pdl_live_apikey_` key with an uppercase character in that 26-character segment is silently missed; change it to `[A-Za-z0-9]{26}` or explain why this segment is actually lowercase-only despite the comment and PR description.
Nits — 6 non-blocking
  • review-enrichment/test/secret-scan.test.ts:1150 only tests the `live` Paddle environment even though the rule also accepts `sdbx`, so add a sandbox positive case to keep that alternation covered.
  • review-enrichment/test/secret-scan.test.ts:1150 should include an uppercase character in the first Paddle segment once the regex is corrected, because the current all-lowercase fixture would not catch the base62 mismatch.
  • Use `\bpdl_(?:live|sdbx)_apikey_[A-Za-z0-9]{26}_[A-Za-z0-9]{22}_[A-Za-z0-9]{3}(?![A-Za-z0-9_-])` at review-enrichment/src/analyzers/secret-scan.ts:403 if the documented Paddle segment is base62.
  • Add a `pdl_sdbx_apikey_...` positive fixture in review-enrichment/test/secret-scan.test.ts near the existing Paddle case.
  • Add a Paddle fixture with uppercase in each base62 segment so the tests prove the rule matches the claimed alphabet, not just the lowercase subset.
  • 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:403 declares the first Paddle key segment as base62 but matches only `[a-z0-9]{26}`, so a valid `pdl_live_apikey_` key with an uppercase character in that 26-character segment is silently missed; change it to `[A-Za-z0-9]{26}` or explain why this segment is actually lowercase-only despite the comment and PR description.
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: 246 registered-repo PR(s), 152 merged, 9 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bohdansolovie; Gittensor profile; 246 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: 246 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:403 declares the first Paddle key segment as base62 but matches only `[a-z0-9]{26}`, so a valid `pdl_live_apikey_` key with an uppercase character in that 26-character segment is silently missed; change it to `[A-Za-z0-9]{26}` or explain why this segment is actually lowercase-only despite the comment and PR description.). 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