fix(miner): share repo-clone.js's path-safety validation across owner/repo CLI parsers - #6120
Conversation
…/repo CLI parsers Closes JSONbored#5831
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6120 +/- ##
===========================================
+ Coverage 48.76% 95.31% +46.55%
===========================================
Files 595 595
Lines 47097 47096 -1
Branches 15030 15030
===========================================
+ Hits 22965 44889 +21924
+ Misses 21488 1476 -20012
+ Partials 2644 731 -1913
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-15 10:24:34 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 3 non-blocking
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://gittensory.aethereal.dev/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.
|
Summary
repo-clone.jsalready had a real path-safety check (character-set + no./..segments) forowner/repovalues, butattempt-cli.js,claim-ledger-cli.js,event-ledger-cli.js, andclaim-ledger.jsonly checked "exactly one slash, both halves non-empty" — an unsafe value likeowner/..orowner baz/repowas accepted at those entry points and either produced a generic downstream error or (for the two ledger CLIs) was persisted unvalidated as a ledger key.repo-clone.js's pattern + traversal check into one exportedisValidRepoSegmenthelper (alongside the existingREPO_SEGMENT_PATTERN/isPathTraversalSegment, now also exported) and pointed all five call sites — includingcross-repo-evaluation.js's previously duplicated copy — at the same source of truth.parseAttemptArgs's{ error }, the ledger CLIs'reportCliFailure,claim-ledger.js's throwninvalid_repo_full_name) — only the validity check got stricter.Closes #5831
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
packages/loopover-miner/lib/**) change with noapps/loopover-ui, OpenAPI, or wrangler-binding surface, so the UI/OpenAPI checks above are unaffected passes rather than active validations of new behavior.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
Not applicable — no UI/frontend/docs-visible change.
Notes
packages/loopover-miner/lib/purge-cli.jshas its ownparseRepoArgwith the same "one slash" weakness but is out of scope: it isn't listed in fix(miner): several owner/repo CLI parsers skip repo-clone.js's path-safety validation #5831's deliverables, and this PR keeps the diff to the exact call sites the issue calls out.