fix(review): tighten generic secret fixture allowlist - #4733
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
07216e8 to
92afa8c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4733 +/- ##
==========================================
- Coverage 94.22% 94.22% -0.01%
==========================================
Files 441 441
Lines 38741 38740 -1
Branches 14117 14117
==========================================
- Hits 36504 36503 -1
Misses 1577 1577
Partials 660 660
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-11 06:33:05 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 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.
|
) PR #5346 (a resubmission of #5341) was auto-closed over two inert test-fixture strings that matched the generic_secret_assignment keyword-plus-quoted-value SHAPE but weren't real credentials -- the same heuristic has now caused at least eight prior false-positive incidents (#2613, #3178, #3673, #3866, #4587, #4733, plus several fixture-rewording commits), each patched by narrowing an allowlist rather than fixing the underlying design. REES's own copy of this rule already rates it "medium confidence" ("catches real keys but also the occasional long opaque non-secret"), and content-lane/security-scan.ts's own header states the design principle this violated: a gate that auto-closes with no human queue may only hard-close on a signal unambiguous enough that a false positive is essentially impossible. Split generic_secret_assignment out of HARD_SECRET_KINDS into a new ADVISORY_ONLY_SECRET_KINDS: it still surfaces (a warning-severity possible_secret_assignment finding / a "manual" content-lane verdict), but never auto-blocks or auto-closes on its own. Concrete credential formats (github_token, aws_access_key, private_key_block, ...) are unaffected and remain unconditional hard blockers. Also add a structural placeholder heuristic (looksLikeDescriptive PlaceholderPhrase, mirrored in REES): a value with 5+ lowercase-only hyphen/underscore segments containing an English function word reads as written prose describing the value, not a credential or a chosen passphrase -- this independently resolves both PR #5346 literals without weakening detection of a genuine human-chosen passphrase like "correct-horse-battery-secret" (no function words, by design).
Motivation
-token/-secret/-key/-password/-passwd) and caused false-negative secret-scan behavior across the Worker, content-lane, and review-enrichment scanners.generic_secret_assignmentfor real credentials.Description
self-namingsuffix exemption with a closed allowlist calledKNOWN_FIXTURE_SECRET_VALUESin the three scanner copies atsrc/review/secrets-scan.ts,src/review/content-lane/security-scan.ts, andreview-enrichment/src/analyzers/secret-scan.tsso only explicit, reviewed fixture literals are exempted.SetinsideisPlaceholderSecretValueto avoid suppressing real credentials that happen to end with secret-kind words.client_secret = "correct-horse-battery-secret",password = "legacy-system-passwd", andapi_key = "internal-service-key"still producegeneric_secret_assignmentfindings (tests intest/unit/secrets-scan.test.ts,test/unit/content-lane-security-scan.test.ts, andreview-enrichment/test/secret-scan.test.ts).Testing
npx vitest run test/unit/secrets-scan.test.ts test/unit/content-lane-security-scan.test.tsand all tests passed (110tests across the two suites succeeded).npm --prefix review-enrichment run build && cd review-enrichment && node --test --experimental-strip-types test/secret-scan.test.tsand the targeted scanner tests passed.npm run typechecksucceeded andgit diff --checkproduced no problems.npm audit --audit-level=moderatecould not complete in this environment (registry audit endpoint returned403 Forbidden).Codex Task