fix(review): scan patch-less PR files for leaked secrets - #3481
fix(review): scan patch-less PR files for leaked secrets#3481RealDiligent wants to merge 3 commits into
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>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-05 09:24:33 UTC
🛑 Suggested Action - Reject/Close
Review summary Blockers
Nits — 5 non-blocking
Why this is blocked
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.
|
|
Gittensory is closing this pull request on the maintainer's behalf (AI reviewers agree on a likely critical defect: src/queue/patchless-secret-scan.ts:128 passes SECRET_SCAN_PATCH_FALLBACK_MAX_CHARS as the fetch limit and then checks `headContent.length > SECRET_SCAN_PATCH_FALLBACK_MAX_CHARS`, but the existing grounding caller uses `limit + 1` specifically to detect truncation, so a real oversized patch-less file can be truncated to exactly 512000 chars, treated as complete, and hide a secret after the cap; change the head/base fetches to request `SECRET_SCAN_PATCH_FALLBACK_MAX_CHARS + 1` before the existing `isOverSecretScanContentLimit` checks.). 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3481 +/- ##
==========================================
+ Coverage 93.03% 93.05% +0.01%
==========================================
Files 298 299 +1
Lines 31203 31281 +78
Branches 11386 11414 +28
==========================================
+ Hits 29029 29107 +78
Misses 1518 1518
Partials 656 656
🚀 New features to boost your workflow:
|
…#3493) * fix(review): scan patch-less PR files for leaked secrets (#2821) 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> * test(review): cover default-status branch for patch-less secret scan (#3464) Co-authored-by: Cursor <cursoragent@cursor.com> * fix(review): use +1 fetch probe for patch-less secret scan cap (#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> * fix(review): precheck patch-less fetch and cap incomplete-path detail 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> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Problem
GitHub omits inline
patchfor binary/large PR files; the unconditionalsecret_leakgate only scanned inline diff+lines, so credentials in patch-less files could bypass the hard blocker.Fix
src/queue/patchless-secret-scan.ts— fetch head/base via Contents API, synthesize scannable+lines, fail closed on oversized/unfetchable content.maybeAddSecretLeakFindingat gate time.Pre-PR validation
npm run typechecktest/unit/patchless-secret-scan.test.ts(41 tests, 100% patch coverage locally)Supersedes closed #3473 (codecov passed but auto-closed without merge).