Skip to content

make gix-ignore/fuzz less vulnerable to pathological gix-glob input#2579

Merged
Sebastian Thiel (Byron) merged 2 commits into
mainfrom
gix-ignore-fuzz-timeout
May 7, 2026
Merged

make gix-ignore/fuzz less vulnerable to pathological gix-glob input#2579
Sebastian Thiel (Byron) merged 2 commits into
mainfrom
gix-ignore-fuzz-timeout

Conversation

@Byron
Copy link
Copy Markdown
Member

@Byron Sebastian Thiel (Byron) commented May 6, 2026

The fuzzer keeps finding ways to exploit gix-glob.
And maybe this time there should be a way to fix this once and for all.
Thinking about this, Forges have to be very careful about this and essentially
can't run certain parts of Git in or risk being DDoS'ed.

Tasks

  • reproduce
  • fix (permanently, hopefully)

@Byron Sebastian Thiel (Byron) force-pushed the gix-ignore-fuzz-timeout branch 2 times, most recently from 8f64e45 to f910748 Compare May 6, 2026 23:05
@Byron Sebastian Thiel (Byron) marked this pull request as ready for review May 6, 2026 23:43
Copilot AI review requested due to automatic review settings May 6, 2026 23:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens gix-glob’s wildmatch implementation against pathological glob inputs that can trigger excessive retry/backtracking behavior (as surfaced by fuzzing), aiming to reduce DoS potential when matching repository-relative paths.

Changes:

  • Adjust wildmatch’s * handling to propagate abort signals (AbortToStarStar / AbortAll) instead of treating certain failure modes as ordinary non-matches.
  • Add a regression test exercising a previously problematic pattern/path combination to ensure the matcher returns promptly.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
gix-glob/src/wildmatch.rs Changes *-matching failure returns to propagate abort results and avoid pathological retry behavior.
gix-glob/tests/pattern/matching.rs Adds a regression test case for a pathological input discovered via fuzzing.

Comment thread gix-glob/tests/pattern/matching.rs
Codex (codex) and others added 2 commits May 7, 2026 08:29
Propagate `AbortToStarStar`/`AbortAll` from `*` handling in the
same cases as Git's wildmatch implementation instead of collapsing
them to `NoMatch`.

This avoids retrying later text positions when a `*` followed by a
literal already proved that no viable match exists within the current
path component. Add a regression test for a fuzz-discovered pattern/path
pair that Git rejects immediately but previously caused pathological
runtime in `gix-glob`.

Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
@Byron Sebastian Thiel (Byron) merged commit 9a17734 into main May 7, 2026
32 checks passed
@Byron Sebastian Thiel (Byron) deleted the gix-ignore-fuzz-timeout branch May 7, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants