fix(miner): guard repo segments in 4 more normalizeRepoFullName parsers - #7837
fix(miner): guard repo segments in 4 more normalizeRepoFullName parsers#7837bidobird 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
88c359c to
8cf3570
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7837 +/- ##
==========================================
- Coverage 88.85% 87.72% -1.13%
==========================================
Files 88 92 +4
Lines 21214 21486 +272
Branches 3675 3733 +58
==========================================
Hits 18849 18849
- Misses 2187 2459 +272
Partials 178 178
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-21 15:02:22 UTC
Review summary Nits — 3 non-blocking
CI checks failing
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 (CI is failing (codecov/patch, validate, validate-tests-merge)). 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. |
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 then 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 pre-existing "one slash, non-empty halves" check is unchanged; this only rejects the./../control-char cases it let through.Tests
Each file's existing malformed-repo test is extended with path-traversal cases for both the owner segment (
../etc) and the repo segment (owner/..), matchingtest/unit/miner-claim-ledger.test.ts's own assertion for the already-fixed siblings.Closes #7795