Skip to content

[GHSA-qf89-h82f-h5r5] - mcp-server-git: git_merge overwrites ignored local files on a merge commit #5671

Done

Description

@cliffhall

Advisory: GHSA-qf89-h82f-h5r5

Server: mcp-server-git · Severity: low (verified) · Milestone: v2.6.0

Problem

git_merge promises to refuse a merge that would overwrite an ignored local file (such as .env). It passes --no-overwrite-ignore, but Git does not honor that flag on a non-fast-forward merge, so a merge commit overwrote ignored local files with the merged branch's version.

Fix

Check before merging, by file identity (so case and Unicode spellings on macOS and Windows are caught), whether any path the merge would write is an ignored local file, including the side names Git uses in a file/directory conflict, and refuse if so. Directory-rename detection is turned off for the merge so the paths it writes are predictable.

The fix is in the linked pull request. Reproduction details stay in the advisory until it is published.

Activity

  1. added
    bug
    server-git
    on Nov 27, 2026
  2. self-assigned this
    on Nov 27, 2026
  3. added this to the v2.6.0 milestone on Nov 27, 2026
  4. changed the title [-][GHSA-qf89-h82f-h5r5][/-] [+][GHSA-qf89-h82f-h5r5] - mcp-server-git: git_merge overwrites ignored local files on a merge commit[/+] on Nov 27, 2026
  5. cliffhall commented on Nov 27, 2026

    @cliffhall
    MemberAuthor

    Fixed by #5679.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugserver-gitv2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions