fix(mcp): avoid regex slash trimming in remote parsing - #1947
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | b91d628 | Commit Preview URL Branch Preview URL |
Jul 01 2026, 12:57 AM |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-01 04:30:35 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 3 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 #1947 +/- ##
=======================================
Coverage 95.56% 95.56%
=======================================
Files 217 217
Lines 24139 24139
Branches 8749 8749
=======================================
Hits 23068 23068
Misses 438 438
Partials 633 633 🚀 New features to boost your workflow:
|
Motivation
replace(/\/+$/, ""), which can trigger quadratic backtracking on attacker-controlled long runs of slashes and hang local MCP/CLI runs.Description
parseGitRemotewith a linearstripTrailingSlashesscanner to avoid regex backtracking (file:packages/gittensory-mcp/lib/local-branch.js).owner/repo) intact so behavior is preserved for valid remotes.test/unit/local-branch.test.tsthat cover multiple trailing slashes and a crafted long slash-run followed by a non-slash to exercise the previously-vulnerable path.Testing
npx vitest run test/unit/local-branch.test.ts -t "parses remotes"and it passed.npm run build:mcp,npm run test:mcp-pack, andnpm run typecheckcompleted successfully.npm run test:coverage/npm run test:cicould not complete in this environment becauseactionlintsetup failed due to network/DNS issues and the audit endpoint returned403 Forbidden, and a scoped coverage run showed the focused test passed but global coverage thresholds were not met when only the single-file coverage was measured.Codex Task