fix(server): stop clone URLs being parsed as git options - #8121
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesClone argument safety
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change ensures clone URLs and destination names are treated as positional Git arguments, preventing dash-prefixed inputs from being parsed as options. Its scope is localized and covered by regression tests, so no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The production change modifies how untrusted clone URLs and destination names are passed to Git, addressing a security-sensitive option-parsing path. The scope is narrow and regression coverage is included, but the command-invocation security implications warrant additional scrutiny. You can add or adjust custom eligibility rules. Learn more. |
|
Review: correct ✅ The Verified:
The PR's tests mock
One minor caveat: Findings (non-blocking, same class elsewhere):
Neither blocks this PR — the fix is narrow, correct, and tested. Safe to merge. Model: |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
User-provided clone URLs were passed to
git clonebefore an end-of-options marker. A URL beginning with-could therefore be parsed as a Git option instead of a repository value.Add
--before the remote URL and destination so both remain positional arguments, and add focused regression coverage for normal and dash-prefixed clone inputs.Tests:
vp test run apps/server/src/sourceControl/SourceControlRepositoryService.test.tsvp run --filter t3 typecheckModel:
openai/gpt-5.6-solvia OpenCodeNote
Medium Risk
Changes how clone commands are built for untrusted URLs; scope is narrow but touches security-sensitive shell/git invocation.
Overview
Fixes a command-injection class issue where user-supplied clone URLs passed directly to
git clonecould be interpreted as Git flags when they start with-(e.g.--upload-pack=...).cloneRepositorynow inserts Git’s end-of-options marker (--) before the remote URL and destination directory name so both are always treated as positional arguments. Existing clone expectations were updated, and a regression test asserts dash-prefixed URLs are forwarded safely.Reviewed by Cursor Bugbot for commit 368ecef. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Pass
--before clone URL and directory inSourceControlRepositoryService.cloneRepositoryInserts an end-of-options marker (
--) into the git clone args in SourceControlRepositoryService.ts so dash-prefixedremoteUrlordirectoryNamevalues are treated as positional arguments instead of git options. Adds a test for dash-prefixed remote URLs and updates an existing test to assert the new args.Macroscope summarized 368ecef.
Summary by CodeRabbit