Skip to content

git.allow_any_sha1_in_want=false does not block arbitrary object wants #77

Open

Description

@behinddwalls

Summary

Setting git.allow_any_sha1_in_want = false does not prevent clients from requesting arbitrary object IDs.

Current behavior

The configuration field exists, but upload-pack is initialized with arbitrary SHA-1 wants enabled unconditionally. The gix fetch path also accepts arbitrary wants without consulting the setting. As a result, changing the option to false has no effect.

Expected behavior

When the option is disabled, upload-pack should only accept wants reachable from advertised refs. Both the stock Git and gix serving paths should enforce the same policy.

Suggested implementation

Thread the configured value through upload-pack setup and the gix want validation path, and add protocol tests covering allowed and rejected wants for both values. Since the project is pre-1.0, remove the option instead if unrestricted wants are the only supported design.

Relevant code

  • crates/walgit-config/src/lib.rs:572
  • crates/walgit-git/src/lib.rs:636
  • crates/walgit-git/src/lib.rs:3331

Activity

  1. behinddwalls commented on Sep 30, 2026

    @behinddwalls
    Author

    Draft fix: #85

    This PR is part of the ordered draft stack #85 through #92.

  2. added a commit that references this issue on Oct 14, 2026
    06a0ef3
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions