Skip to content

fix(api,sync): Delimit positional arguments in git clone mirror invocations #374

Closed

Description

@euxarist

Description

In crates/gitlawb-node/src/api/repos.rs (fork_repo) and crates/gitlawb-node/src/sync.rs (clone_repo), git clone --mirror passes positional arguments without preceding -- delimiters.

Proposed Fix

Add -- before positional path/URL arguments in git clone --mirror invocations across repos.rs and sync.rs.

Activity

  1. added
    crate:node
    kind:security
    sev:high
    subsystem:api
    subsystem:replication
    on Aug 23, 2026
  2. added
    sev:low
    kind:bug
    and removed
    kind:security
    sev:high
    on Aug 25, 2026
  3. beardthelion commented on Aug 25, 2026

    @beardthelion
    Collaborator

    Downgraded to sev:low and kind:bug. The fix in #376 is right and I have approved it, so this is about
    the severity label rather than the change.

    I could not reach the execution described here, for two independent reasons.

    Peer origins are composed as http(s)://... before they reach the clone, and every production write
    to peers.http_url funnels through is_public_http_url. I ran eleven dash-leading forms through
    that gate, including leading space, tab, newline and NUL variants, and it rejects all of them, with
    passing controls so the result is not vacuous. remote_url therefore cannot begin with -.

    Setting that gate aside, the argv shape does not permit it either. Consuming the injected string as
    an option leaves the destination as the only positional, and process_batch calls clone_repo only
    when that path does not yet exist. Git then fails at fatal: repository '<dest>' does not exist
    before it opens any transport. fork_repo is the same story, with both arguments built as
    repos_dir joins.

    To be clear about what is real: --upload-pack does execute, through a shell, when the remaining
    positional is an actual repository. I confirmed that separately. It just is not a shape these call
    sites can produce. That is why this is low rather than closed as invalid, and why the delimiter is
    still worth having.

  4. added 5 commits that reference this issue on Nov 7, 2026
    dfe8a17
    c65722f
    641c810
    20cd5c0
    7abb729
  5. added a commit that references this issue on Nov 10, 2026
    0cdb4bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate:nodekind:bugsev:lowsubsystem:apisubsystem:replication

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions