CVE-2025-24890: Gix sec Gix-sec Safe.directory Protections Absent For Vulnerability

MODERATE
Advisory Identifier: GHSA-7rhf-42qf-vrvc
CVSS 6.8
CWE-283
Published
Advisory Summary

CVE-2025-24890 is a MODERATE (CVSS 6.8) gix-sec safe.directory protections absent for vulnerability (CWE-283: Unverified Ownership) affecting Gix sec libraries in the crates.io ecosystem. The issue involves gix-sec safe.directory protections absent for elevated administrators. Remediation is available by upgrading affected packages to version 0.13.3.

CVE-2025-24890 at a Glance

CVE Identifier CVE-2025-24890
GHSA Identifier GHSA-7rhf-42qf-vrvc
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-283: Unverified Ownership
Affected Product Gix sec
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 6.8

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

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

How to Fix CVE-2025-24890

To remediate this vulnerability, upgrade all affected Gix sec 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-sec fixed: 0.13.3
Upgrade gix-sec to 0.13.3
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-sec

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-24890, inspect your project dependencies for Gix sec:

inspect dependencies for gix-sec

Analyze the terminal output to locate any version of Gix sec in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.13.3), 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-283: Unverified Ownership, where the product does not properly verify that a critical resource is owned by the proper entity. In Gix sec, 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 In a process run with full administrative rights on Windows, `gix-sec` wrongly treats all locations as trusted, leading to the execution of commands configured in repositories controlled by limited user accounts. ### Details In a similar way to Git, gitoxide tries to avoid operating in local repositories that it neither considers to be owned by the current user nor finds to match any value of `safe.directory`. [This is because](https://git-scm.com/docs/git.html#_security) of the numerous commands that can be configured for a Git repository, to run as part of various actions, some of which even occur automatically due to the way custom shell prompts and text editors update their knowledge of repositories. On Unix-like operating systems, every directory is considered to be owned by some user ID. On Windows, other identities can own a directory in the same sense that a user can, and directories created while operating with full administrative rights default to being owned by the `Administrators` group, not the specific user. Such administrators should be able to use what are, conceptually, their own repositories. So Git considers administrators (when operating this way) to own them. Code in `gix-sec` intends to implement a similar check. But after finding that it is run with an administrative token, it needs to check if the directory is owned by the `Administrators` group, yet instead accidentally examines *itself* again, rather than the directory. Specifically, in `gix_sec::identity` the [implementation](https://github.com/GitoxideLabs/gitoxide/blob/main/gix-sec/src/identity.rs#L81) of `is_path_owned_by_current_user` for Windows [finds the owner of the directory](https://github.com/GitoxideLabs/gitoxide/blob/ffb73b5f69dbe86ff88f1c473af65f368a6bcbe5/gix-sec/src/identity.rs#L109-L121) (`folder_owner`), [finds the owner of the running thread or process](https://github.com/GitoxideLabs/gitoxide/blob/ffb73b5f69dbe86ff88f1c473af65f368a6bcbe5/gix-sec/src/identity.rs#L151-L189) (`token_owner`), checks cases of ownership not specific to administrators, then attempts to check the administrator-specific case with: https://github.com/GitoxideLabs/gitoxide/blob/ffb73b5f69dbe86ff88f1c473af65f368a6bcbe5/gix-sec/src/identity.rs#L197-L207 The [`IsWellKnownSid`](https://learn.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-iswellknownsid) call checks if the owner of the current thread or process is the `Administrators` group. By default, operations carried out when running as an administrator with UAC elevation--or using an administrative account for which UAC is turned off altogether--create not just files and directories with the `Administrators` group as the owner, but other [securable objects](https://learn.microsoft.com/en-us/windows/win32/secauthz/securable-objects) as well, including processes and threads. So this check returns true. (Based on the comment, it may be that this was really meant to check if the *directory* is owned by an administrator. But nothing related to the directory appears in this check.) The [`CheckTokenMembership`](https://learn.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-checktokenmembership) call checks if the owner of the current thread or process is an identity enabled in the access token represented by the token handle of `NULL`, passed as `0`. But a token handle of `NULL` represents the running thread. Consequently, if we have gotten this far--which happens when running with full administrative rights--in nearly all situations this will return true as well. (Based on the message, it may be that this was really meant to check if the user is an *administrator*. But nothing related to the `Administrators` group appears in this check.) ### PoC These examples use `gix fetch` for simplicity, but some other actions implemented in gitoxide are vulnerable, as well as any provided by applications that rely on the results of `gix-sec` checks. #### Example 1: From inside a shared or user profile directory On Windows, running as a limited user account, create a repository in a shared location like `C:\Users\Public`, or even within the limited user's user profile directory. Configure a fake (or, if preferred, real) remote and a value of `core.sshCommand` that runs an arbitrary payload. For example, in PowerShell: ```powershell git init unsafe-repo cd unsafe-repo git remote add origin ssh://localhost/repo.git git config core.sshCommand 'calc.exe; ssh' ``` Switch from the limited account to an administrative account. Then: 1. If gitoxide is not installed, install it, such as with `cargo install gitoxide`. 2. Run PowerShell with UAC elevation, so that it and processes started in it have an unfiltered token. (If UAC is turned off for this account, then just run PowerShell normally.) 3. This example will not work if the `GIT_SSH_COMMAND` environment variable is set. It is not usually set, but if it may be, you can unset it in the current shell environment by running `$env:GIT_SSH_COMMAND = $null`. 4. `cd` to the limited user's repository as created above. 5. Run `gix fetch`. This runs the Windows calculator (the chosen payload). #### Example 2: From anywhere On Windows, even limited user accounts can create directories in the root of the system drive. As a limited user--and assuming the system drive is `C:`--initialize `C:\` itself as a repository. Set up the repository to run the payload, either by editing `C:\.git\config` manually, or by running the `git remote` and `git config` commands from example 1 but passing `-c safe.directory=.`. The second approach is as follows: ```powershell cd C:\ git init git -c safe.directory=. remote add origin ssh://localhost/repo.git git -c safe.directory=. config core.sshCommand 'calc.exe; ssh' ``` (`-c safe.directory=.` keeps `git` from refusing to run the `git remote` and `git config` commands on the repository it has just created, whose `.git` directory is under its control but whose working tree is not.)   The entire system drive is now a Git repository due to the presence of `C:\.git`. The limited user owns this `.git` directory and controls the configuration in it. Normally `safe.directory` protections keep this from being a problem. But they are ineffective for administrators running applications (such as the `gix` command) that use `gix-sec` to enforce those protections. Switch from the limited account to an administrative account. Follow the instructions for the administrator from example 1, except do so from *any* directory anywhere on the `C:` drive that is not in its own repository. Unless `GIT_CEILING_DIRECTORIES` is set in such a way that keeps `C:\` from being considered, running `gix fetch` again runs the Windows calculator. This happens even if the command is run from inside the administrator's own user profile directory. ### Impact A user is affected only when *all* of the following apply: - The operating system is Windows. - The user is a member of the `Administrators` group. - The program is run with the user's unfiltered token. This happens when UAC is enabled and the user runs the program with UAC elevation, as well as when UAC is disabled. (Running as an administrator but enabling UAC and running the program unelevated is sufficient to avoid this vulnerability.) - The program uses and relies on information from `gix-sec` about what directories to trust. - The program interacts with a repository owned by, and set up or controlled by, another user. Then operations that would run code present in a repository's configuration or hooks when the repository is trusted will be performed in any repository. These operations often require user interaction. But this interaction may not seem to the user like it involves operations on a repository, if it is performed as part of a custom prompt for a shell, or by other software that integrates with repositories. It may also not seem like it involves operation on files controlled by another user, such as when the repository is the root of the system drive. A malicious user with a limited account on the system may therefore be able to arrange for an administrator to run arbitrary code. However, this vulnerability does not affect cloning repositories or using repositories one has cloned, because cloning does not copy configuration and hooks into the local repository. The specific attack of making the root of the system drive a repository resembles [CVE-2022-24765](https://github.com/git-for-windows/git/security/advisories/GHSA-vw2c-22j4-2fh2). The workarounds presented there do not work around this vulnerability in full, but would prevent that kind of attack.

CVE-2025-24890 Affected Gix sec Versions

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

References

Frequently Asked Questions

What is CVE-2025-24890?
CVE-2025-24890 is a security vulnerability in Gix sec involving gix-sec safe.directory protections absent for elevated administrators under CWE-283: Unverified Ownership.
Which Gix sec versions are affected?
Affected versions include releases prior to 0.13.3 across affected packages: gix-sec.
What version fixes CVE-2025-24890?
Upgrading to 0.13.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gix-sec affected?
Yes, gix-sec is affected in releases prior to 0.13.3. Upgrade your dependency to 0.13.3 or later.
What is the CVSS score of CVE-2025-24890?
CVE-2025-24890 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2025-24890?
CVE-2025-24890 is classified under CWE-283: Unverified Ownership (The product does not properly verify that a critical resource is owned by the proper entity.).
How can I check crates.io dependencies for CVE-2025-24890?
Run the dependency tree command: 'inspect dependencies for gix-sec'. 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-7rhf-42qf-vrvc",
  "modified" : "2026-09-09T16:34:36Z",
  "published" : "2026-09-09T16:34:35Z",
  "aliases" : [ "CVE-2025-24890" ],
  "summary" : "gix-sec safe.directory protections absent for elevated administrators",
  "details" : "### Summary\n\nIn a process run with full administrative rights on Windows, `gix-sec` wrongly treats all locations as trusted, leading to the execution of commands configured in repositories controlled by limited user accounts.\n\n### Details\n\nIn a similar way to Git, gitoxide tries to avoid operating in local repositories that it neither considers to be owned by the current user nor finds to match any value of `safe.directory`. [This is because](https://git-scm.com/docs/git.html#_security) of the numerous commands that can be configured for a Git repository, to run as part of various actions, some of which even occur automatically due to the way custom shell prompts and text editors update their knowledge of repositories.\n\nOn Unix-like operating systems, every directory is considered to be owned by some user ID. On Windows, other identities can own a directory in the same sense that a user can, and directories created while operating with full administrative rights default to being owned by the `Administrators` group, not the specific user. Such administrators should be able to use what are, conceptually, their own repositories. So Git considers administrators (when operating this way) to own them.\n\nCode in `gix-sec` intends to implement a similar check. But after finding that it is run with an administrative token, it needs to check if the directory is owned by the `Administrators` group, yet instead accidentally examines *itself* again, rather than the directory.\n\nSpecifically, in `gix_sec::identity` the [implementation](https://github.com/GitoxideLabs/gitoxide/blob/main/gix-sec/src/identity.rs#L81) of `is_path_owned_by_current_user` for Windows [finds the owner of the directory](https://github.com/GitoxideLabs/gitoxide/blob/ffb73b5f69dbe86ff88f1c473af65f368a6bcbe5/gix-sec/src/identity.rs#L109-L121) (`folder_owner`), [finds the owner of the running thread or process](https://github.com/GitoxideLabs/gitoxide/blob/ffb73b5f69dbe86ff88f1c473af65f368a6bcbe5/gix-sec/src/identity.rs#L151-L189) (`token_owner`), checks cases of ownership not specific to administrators, then attempts to check the administrator-specific case with:\n\nhttps://github.com/GitoxideLabs/gitoxide/blob/ffb73b5f69dbe86ff88f1c473af65f368a6bcbe5/gix-sec/src/identity.rs#L197-L207\n\nThe [`IsWellKnownSid`](https://learn.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-iswellknownsid) call checks if the owner of the current thread or process is the `Administrators` group. By default, operations carried out when running as an administrator with UAC elevation--or using an administrative account for which UAC is turned off altogether--create not just files and directories with the `Administrators` group as the owner, but other [securable objects](https://learn.microsoft.com/en-us/windows/win32/secauthz/securable-objects) as well, including processes and threads. So this check returns true. (Based on the comment, it may be that this was really meant to check if the *directory* is owned by an administrator. But nothing related to the directory appears in this check.)\n\nThe [`CheckTokenMembership`](https://learn.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-checktokenmembership) call checks if the owner of the current thread or process is an identity enabled in the access token represented by the token handle of `NULL`, passed as `0`. But a token handle of `NULL` represents the running thread. Consequently, if we have gotten this far--which happens when running with full administrative rights--in nearly all situations this will return true as well. (Based on the message, it may be that this was really meant to check if the user is an *administrator*. But nothing related to the `Administrators` group appears in this check.)\n\n### PoC\n\nThese examples use `gix fetch` for simplicity, but some other actions implemented in gitoxide are vulnerable, as well as any provided by applications that rely on the results of `gix-sec` checks. \n\n#### Example 1: From inside a shared or user profile directory\n\nOn Windows, running as a limited user account, create a repository in a shared location like `C:\\Users\\Public`, or even within the limited user's user profile directory. Configure a fake (or, if preferred, real) remote and a value of `core.sshCommand` that runs an arbitrary payload. For example, in PowerShell:\n\n```powershell\ngit init unsafe-repo\ncd unsafe-repo\ngit remote add origin ssh://localhost/repo.git\ngit config core.sshCommand 'calc.exe; ssh'\n```\n\nSwitch from the limited account to an administrative account. Then:\n\n1. If gitoxide is not installed, install it, such as with `cargo install gitoxide`.\n2. Run PowerShell with UAC elevation, so that it and processes started in it have an unfiltered token. (If UAC is turned off for this account, then just run PowerShell normally.)\n3. This example will not work if the `GIT_SSH_COMMAND` environment variable is set. It is not usually set, but if it may be, you can unset it in the current shell environment by running `$env:GIT_SSH_COMMAND = $null`.\n4. `cd` to the limited user's repository as created above.\n5. Run `gix fetch`. This runs the Windows calculator (the chosen payload).\n\n#### Example 2: From anywhere\n\nOn Windows, even limited user accounts can create directories in the root of the system drive. As a limited user--and assuming the system drive is `C:`--initialize `C:\\` itself as a repository. Set up the repository to run the payload, either by editing `C:\\.git\\config` manually, or by running the `git remote` and `git config` commands from example 1 but passing `-c safe.directory=.`. The second approach is as follows:\n\n```powershell\ncd C:\\\ngit init\ngit -c safe.directory=. remote add origin ssh://localhost/repo.git\ngit -c safe.directory=. config core.sshCommand 'calc.exe; ssh'\n```\n\n(`-c safe.directory=.` keeps `git` from refusing to run the `git remote` and `git config` commands on the repository it has just created, whose `.git` directory is under its control but whose working tree is not.)\n \nThe entire system drive is now a Git repository due to the presence of `C:\\.git`. The limited user owns this `.git` directory and controls the configuration in it. Normally `safe.directory` protections keep this from being a problem. But they are ineffective for administrators running applications (such as the `gix` command) that use `gix-sec` to enforce those protections.\n\nSwitch from the limited account to an administrative account. Follow the instructions for the administrator from example 1, except do so from *any* directory anywhere on the `C:` drive that is not in its own repository. Unless `GIT_CEILING_DIRECTORIES` is set in such a way that keeps `C:\\` from being considered, running `gix fetch` again runs the Windows calculator. This happens even if the command is run from inside the administrator's own user profile directory.\n\n### Impact\n\nA user is affected only when *all* of the following apply:\n\n- The operating system is Windows.\n- The user is a member of the `Administrators` group.\n- The program is run with the user's unfiltered token. This happens when UAC is enabled and the user runs the program with UAC elevation, as well as when UAC is disabled. (Running as an administrator but enabling UAC and running the program unelevated is sufficient to avoid this vulnerability.)\n- The program uses and relies on information from `gix-sec` about what directories to trust.\n- The program interacts with a repository owned by, and set up or controlled by, another user.\n\nThen operations that would run code present in a repository's configuration or hooks when the repository is trusted will be performed in any repository. These operations often require user interaction. But this interaction may not seem to the user like it involves operations on a repository, if it is performed as part of a custom prompt for a shell, or by other software that integrates with repositories. It may also not seem like it involves operation on files controlled by another user, such as when the repository is the root of the system drive.\n\nA malicious user with a limited account on the system may therefore be able to arrange for an administrator to run arbitrary code. However, this vulnerability does not affect cloning repositories or using repositories one has cloned, because cloning does not copy configuration and hooks into the local repository.\n\nThe specific attack of making the root of the system drive a repository resembles [CVE-2022-24765](https://github.com/git-for-windows/git/security/advisories/GHSA-vw2c-22j4-2fh2). The workarounds presented there do not work around this vulnerability in full, but would prevent that kind of attack.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "gix-sec"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.13.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.13.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/GitoxideLabs/gitoxide/security/advisories/GHSA-7rhf-42qf-vrvc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/GitoxideLabs/gitoxide/commit/39e37482d6f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/GitoxideLabs/gitoxide"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-283" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-09T16:34:35Z",
    "nvd_published_at" : null
  }
}