CVE-2026-44471: gix-fs Symlink Prefix-reuse Allows Worktree Escape Vulnerability

HIGH
Advisory Identifier: GHSA-f89h-2fjh-2r9q
CVSS 7.8
CWE-59
Published
Advisory Summary

CVE-2026-44471 is a HIGH (CVSS 7.8) symlink prefix-reuse allows worktree escape vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting gix-fs libraries in the crates.io ecosystem. The issue involves symlink prefix-reuse allows worktree escape during checkout. Remediation is available by upgrading affected packages to version 0.21.1.

CVE-2026-44471 at a Glance

CVE Identifier CVE-2026-44471
GHSA Identifier GHSA-f89h-2fjh-2r9q
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-59: Improper Link Resolution Before File Access ('Link Following')
Affected Product gix-fs
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-44471

To remediate this vulnerability, upgrade all affected gix-fs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gix-fs fixed: 0.21.1
Upgrade gix-fs to 0.21.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for gix-fs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-44471, inspect your project dependencies for gix-fs:

inspect dependencies for gix-fs

Analyze the terminal output to locate any version of gix-fs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.21.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In gix-fs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary A malicious tree can be constructed that will, when checked out with gitoxide, permit writing an attacker-controlled symlink into any existing directory the user has write access to. ### Details During checkout, all symlink index entries are deferred and created after regular files using a single shared `gix_worktree::Stack`. Internally, this uses a `gix_fs::Stack`. `gix_fs::Stack::make_relative_path_current()` caches validated path prefixes: when the previously-processed leaf component exactly matches the leading component(s) of the next path, the leaf-to-directory transition at `gix-fs/src/stack.rs:195-197` invokes only `delegate.push_directory()`, never `delegate.push()`. In `gix_worktree::stack::delegate::StackDelegate`, when the state member is `State::CreateDirectoryAndAttributesStack`, `Attributes::push_directory()` only loads attributes (from the ODB, in the clone case), and does not perform any other checks. The on-disk `symlink_metadata()` check and unlink-on-collision live in `StackDelegate::push()`'s invocation of `create_leading_directory()`, which is therefore bypassed for the cached prefix. The final symlink is created with plain `std::os::unix::fs::symlink`, which follows symlinks in parent directories. Therefore, it's possible to provide a tree with duplicate symlink and directory entries that exploits this. If a tree is constructed with: 1. A `120000` (symlink) entry `a` that points to `.git/hooks`. 2. A `040000` (directory) entry `a` with a subtree that contains a symlink from `post-checkout` to `../../payload`. 3. A `100755` (executable file) entry `payload`. This is converted by `gix_index::State::from_tree()` into index entries `["a" (SYMLINK), "a/post-checkout" (SYMLINK)]`. Then, during the delayed symlink phase: 1. `a` is created as a symlink to e.g. `.git/hooks`. 2. When processing `a/post-checkout`, the `a` prefix is reused from the just-processed leaf entry without re-running the intermediate-directory check, after which… 3. `symlink(target, "<wt>/a/post-checkout")` resolves through the just-created symlink to write `.git/hooks/post-checkout`. Although this example uses `.git/hooks` for simplicity, there's no actual requirement to write within the repo checkout. This can be fairly easily chained into code execution by writing to something that is known to be executed — for example, by writing to `.git/hooks/post-checkout` if the attacker knows that a hook-aware Git implementation will be used later, or by writing to something like `~/.local/bin`. ### PoC Attached is [build-bad-repo.sh](https://github.com/user-attachments/files/27223800/build-bad-repo.sh), which builds a repo with the aforementioned tree structure. Cloning it with `gix` will set up the malicious `.git/hooks/post-checkout`, at which point anything that normally invokes the `post-checkout` hook will result in its execution, such as `git checkout -b new-branch`. ### Impact Arbitrary symlink creation into any existing directory the user can write to. ### Disclosure This vulnerability was found by AI (specifically, Claude Mythos) as part of [Project Glasswing](https://www.anthropic.com/glasswing). This advisory was written and verified by a human.

CVE-2026-44471 Affected gix-fs Versions

1 component(s)
Fixed Versions:
0.21.1
Product / Package Ecosystem Affected Versions Fixed Version
gix-fs
crates.io
< 0.21.1
0.21.1

References

Frequently Asked Questions

What is CVE-2026-44471?
CVE-2026-44471 is a security vulnerability in gix-fs involving Symlink prefix-reuse allows worktree escape during checkout under CWE-59: Improper Link Resolution Before File Access ('Link Following').
Which gix-fs versions are affected?
Affected versions include releases prior to 0.21.1 across affected packages: gix-fs.
What version fixes CVE-2026-44471?
Upgrading to 0.21.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gix-fs affected?
Yes, gix-fs is affected in releases prior to 0.21.1. Upgrade your dependency to 0.21.1 or later.
What is the CVSS score of CVE-2026-44471?
CVE-2026-44471 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-44471?
CVE-2026-44471 is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following') (The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.).
How can I check crates.io dependencies for CVE-2026-44471?
Run the dependency tree command: 'inspect dependencies for gix-fs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f89h-2fjh-2r9q",
  "modified" : "2026-05-14T20:43:45Z",
  "published" : "2026-05-07T00:01:28Z",
  "aliases" : [ "CVE-2026-44471" ],
  "summary" : "gix-fs: Symlink prefix-reuse allows worktree escape during checkout",
  "details" : "### Summary\n\nA malicious tree can be constructed that will, when checked out with gitoxide, permit writing an attacker-controlled symlink into any existing directory the user has write access to.\n\n### Details\n\nDuring checkout, all symlink index entries are deferred and created after regular files using a single shared `gix_worktree::Stack`. Internally, this uses a `gix_fs::Stack`.\n\n`gix_fs::Stack::make_relative_path_current()` caches validated path prefixes: when the previously-processed leaf component exactly matches the leading component(s) of the next path, the leaf-to-directory transition at `gix-fs/src/stack.rs:195-197` invokes only `delegate.push_directory()`, never `delegate.push()`.\n\nIn `gix_worktree::stack::delegate::StackDelegate`, when the state member is `State::CreateDirectoryAndAttributesStack`, `Attributes::push_directory()` only loads attributes (from the ODB, in the clone case), and does not perform any other checks. The on-disk `symlink_metadata()` check and unlink-on-collision live in `StackDelegate::push()`'s invocation of `create_leading_directory()`, which is therefore bypassed for the cached prefix. The final symlink is created with plain `std::os::unix::fs::symlink`, which follows symlinks in parent directories.\n\nTherefore, it's possible to provide a tree with duplicate symlink and directory entries that exploits this. If a tree is constructed with:\n\n1. A `120000` (symlink) entry `a` that points to `.git/hooks`.\n2. A `040000` (directory) entry `a` with a subtree that contains a symlink from `post-checkout` to `../../payload`.\n3. A `100755` (executable file) entry `payload`.\n\nThis is converted by `gix_index::State::from_tree()` into index entries `[\"a\" (SYMLINK), \"a/post-checkout\" (SYMLINK)]`.\n\nThen, during the delayed symlink phase:\n\n1. `a` is created as a symlink to e.g. `.git/hooks`.\n2. When processing `a/post-checkout`, the `a` prefix is reused from the just-processed leaf entry without re-running the intermediate-directory check, after which…\n3. `symlink(target, \"<wt>/a/post-checkout\")` resolves through the just-created symlink to write `.git/hooks/post-checkout`.\n\nAlthough this example uses `.git/hooks` for simplicity, there's no actual requirement to write within the repo checkout. This can be fairly easily chained into code execution by writing to something that is known to be executed — for example, by writing to `.git/hooks/post-checkout` if the attacker knows that a hook-aware Git implementation will be used later, or by writing to something like `~/.local/bin`.\n\n### PoC\n\nAttached is [build-bad-repo.sh](https://github.com/user-attachments/files/27223800/build-bad-repo.sh), which builds a repo with the aforementioned tree structure. Cloning it with `gix` will set up the malicious `.git/hooks/post-checkout`, at which point anything that normally invokes the `post-checkout` hook will result in its execution, such as `git checkout -b new-branch`.\n\n### Impact\n\nArbitrary symlink creation into any existing directory the user can write to.\n\n### Disclosure\n\nThis vulnerability was found by AI (specifically, Claude Mythos) as part of [Project Glasswing](https://www.anthropic.com/glasswing). This advisory was written and verified by a human.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "gix-fs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.21.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.21.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/GitoxideLabs/gitoxide/security/advisories/GHSA-f89h-2fjh-2r9q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-44471"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/GitoxideLabs/gitoxide"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-59" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-07T00:01:28Z",
    "nvd_published_at" : "2026-05-13T22:16:46Z"
  }
}