You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[GHSA-9vjp-x34c-xg6v follow-up] - git: repeat the --repository confinement check after a tool writes the working tree #5599
Follow-up to the fix for GHSA-9vjp-x34c-xg6v, which is published and fixed in v2.5.0.
Problem
Under --repository, the git server checks the directories git will use (working tree, git directory, common directory) once per tool call, when it opens the repository. A tool call that rewrites the working tree partway through (merge, checkout, merge abort, autostash apply) can change the repository's effective configuration for the rest of that call; the fix for this advisory re-applies the configuration hardening after each such write, but does not re-run the confinement check. Configuration that changes where git operates (for example core.worktree) could therefore differ from what was validated for the remaining git commands in that call.
Options
Re-run validate_opened_repo after each tree-writing command (inside the same helper that re-hardens), refusing to continue if the repository no longer validates.
Pin the location keys (e.g. core.worktree) at command scope to the values validated at open, so later configuration cannot move them.
Acceptance criteria
After any tree-writing command in a tool call, no later git command in that call operates outside the allowed repository.
A regression test covers a configuration change made by a tree write during a single call.
changed the title [-][GHSA-9vjp-x34c-xg6v follow-up][/-][+][GHSA-9vjp-x34c-xg6v follow-up] - git: repeat the --repository confinement check after a tool writes the working tree[/+]on Nov 18, 2026
Activity
[-][GHSA-9vjp-x34c-xg6v follow-up][/-][+][GHSA-9vjp-x34c-xg6v follow-up] - git: repeat the --repository confinement check after a tool writes the working tree[/+]