fix(miner): guard repo segments in 4 more normalizeRepoFullName parsers - #7999
fix(miner): guard repo segments in 4 more normalizeRepoFullName parsers#7999bidobird wants to merge 1 commit into
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
contribution-profile-cache.ts, prediction-ledger.ts, replay-snapshot.ts, and run-state.ts each define a normalizeRepoFullName that only checks "exactly one slash, both halves non-empty" — they never call repo-clone.ts's isValidRepoSegment, so a `.`/`..`/control-char owner or repo segment (e.g. "../repo", "owner/..") is accepted and persisted as a SQLite key / echoed through the sibling CLIs. Issues JSONbored#5831 and JSONbored#7525 already rolled this exact guard out to the other ten sibling parsers; these four were missed. Add the same `isValidRepoSegment(owner)/isValidRepoSegment(repo)` check each already-fixed sibling uses, and extend each file's existing malformed-repo test with path-traversal cases for both the owner and repo segment. Closes JSONbored#7795
1c09114 to
64dbed9
Compare
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-22 17:31:03 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR). 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❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (25.00%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #7999 +/- ##
===========================================
- Coverage 91.93% 38.18% -53.76%
===========================================
Files 742 4 -738
Lines 76037 275 -75762
Branches 23081 59 -23022
===========================================
- Hits 69906 105 -69801
+ Misses 5037 170 -4867
+ Partials 1094 0 -1094
Flags with carried forward coverage won't be shown. Click here to find out more.
|
What
Four
normalizeRepoFullNameparsers only check "exactly one slash, both halves non-empty" and never callrepo-clone.ts'sisValidRepoSegment, so a./../control-char owner or repo segment (e.g."../repo","owner/..") is accepted and persisted as a SQLite key / echoed through the sibling CLIs:packages/loopover-miner/lib/contribution-profile-cache.tspackages/loopover-miner/lib/prediction-ledger.tspackages/loopover-miner/lib/replay-snapshot.tspackages/loopover-miner/lib/run-state.tsIssues #5831 and #7525 already rolled this exact guard out to the other ten sibling parsers; these four were missed.
Fix
Add the same
isValidRepoSegment(owner) || isValidRepoSegment(repo)check each already-fixed sibling uses, imported from./repo-clone.js— no new validation shape. The existing checks are unchanged; this only rejects the./../control-char cases they let through.Tests
Each file's existing malformed-repo test is extended with path-traversal cases for both the owner (
../etc) and repo (owner/..) segment, matchingtest/unit/miner-claim-ledger.test.ts's assertion for the already-fixed siblings.Closes #7795