fix(review): scan patch-less PR files for leaked secrets (#audit-3.4) - #3493
Conversation
) Extract patch-less secret-scan enrichment into patchless-secret-scan.ts with full unit coverage. When GitHub omits inline diff for binary/large files, fetch head/base content via Contents API and synthesize scannable + lines before the unconditional secret_leak hard blocker runs. Co-authored-by: Cursor <cursoragent@cursor.com>
…SONbored#3464) Co-authored-by: Cursor <cursoragent@cursor.com>
…ored#3481) The grounding FileFetcher returns maxChars+1 when content exceeds the cap; pass SECRET_SCAN_FETCH_PROBE_CHARS so oversized files fail closed instead of scanning a truncated prefix. Co-authored-by: Cursor <cursoragent@cursor.com>
Skip makeGithubFileFetcher when every file already has inline patch. Cap fail-closed advisory path list (title keeps full count). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-05 11:15:09 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3493 +/- ##
==========================================
+ Coverage 93.04% 93.06% +0.01%
==========================================
Files 299 300 +1
Lines 31211 31298 +87
Branches 11389 11421 +32
==========================================
+ Hits 29039 29126 +87
Misses 1517 1517
Partials 655 655
🚀 New features to boost your workflow:
|
Summary
Closes the patch-less bypass gap in the unconditional
secret_leakhard blocker (#audit-3.4). GitHub omits inlinepatchfor binary/large PR files; without Contents API fallback, credentials in those files evaded the gate.Supersedes closed #2821, #3464, #3473, #3481, #3484.
Fix
src/queue/patchless-secret-scan.ts— Contents API fallback synthesizing scannable+lines;+1fetch probe so oversized files fail closed (not truncated-prefix scan)maybeAddSecretLeakFindingwithinstallationId,headSha,baseShamakeGithubFileFetcherwhen every changed file already has inline patch (fix(review): scan patch-less PR files for leaked secrets #3484 review nit)Linked issue / authorization
No dedicated upstream tracking issue existed before contributor attempts #2821–#3484 (the last passed CI + codecov but was auto-closed for missing a pre-existing issue link). This PR implements the security fix those PRs described — completing an outstanding hole in the #audit-3.4 unconditional blocker (shipped in #1237; parent self-host review-gap audit #1936).
Test plan
npm run typechecktest/unit/patchless-secret-scan.test.ts— 44 tests, 100% line coverage onpatchless-secret-scan.tslocally