gix-worktree-state nonexclusive checkout sets executable files world-writable
### Summary `gix-worktree-state` specifies 0777 permissions when checking out executable files, intending that the umask will restrict them appropriately. But one of the strategies it uses to set permissions is not subject to the umask. This causes files in a repository to be world-writable in some situations. ### Details Git repositories track executable bits for regular files. In tree objects and the index, regular file modes are stored as 0644 if not executable, or 0755 if executable. But this is independent of how the permissions are set in the filesystem (where supported). [`gix_worktree_state::checkout`](https://github.com/GitoxideLabs/gitoxide/blob/8d84818240d44e1f5fe78a231b5d9bffd0283918/gix-worktree-state/src/checkout/function.rs#L8-L35) has two strategies for checking out a file and marking it executable on a Unix-like operating system, one of which is vulnerable: - If the file is created by assuming it does not already exist, correct permissions are applied, because permissions specified when opening a file are subject to the umask. - If the file is considered possibly already to exist—even in a clean checkout if the application does not specify the option to treat the destination directory as empty—then permissions conferring unrestricted access to any user account on the system are wrongly applied, because permissions specified when calling chmod on an existing file are not subject to the umask. Specifically, [`checkout::entry::checkout`](https://github.com/Gitox
- Products
- gix-worktree-state
- Affected versions
- Not specified
- Fixed versions
- 0.17.0
- CVEs
- CVE-2025-22620
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 30 Oct 2026, 08:44 UTC · Revision 1
Source evidence
gix-worktree-state nonexclusive checkout sets executable files world-writable
core-osv · Original sourcePublished 18 Jan 2025, 12:00 UTC
### Summary `gix-worktree-state` specifies 0777 permissions when checking out executable files, intending that the umask will restrict them appropriately. But one of the strategies it uses to set permissions is not subject to the umask. This causes files in a repository to be world-writable in some situations. ### Details Git repositories track executable bits for regular files. In tree objects and the index, regular file modes are stored as 0644 if not executable, or 0755 if executable. But this is independent of how the permissions are set in the filesystem (where supported). [`gix_worktree_state::checkout`](https://github.com/GitoxideLabs/gitoxide/blob/8d84818240d44e1f5fe78a231b5d9bffd0283918/gix-worktree-state/src/checkout/function.rs#L8-L35) has two strategies for checking out a file and marking it executable on a Unix-like operating system, one of which is vulnerable: - If the file is created by assuming it does not already exist, correct permissions are applied, because permissions specified when opening a file are subject to the umask. - If the file is considered possibly already to exist—even in a clean checkout if the application does not specify the option to treat the destination directory as empty—then permissions conferring unrestricted access to any user account on the system are wrongly applied, because permissions specified when calling chmod on an existing file are not subject to the umask. Specifically, [`checkout::entry::checkout`](https://github.com/Gitox
osv:RUSTSEC-2025-0001
gix-worktree-state
Fixed versions: 0.17.0
Complete source record
{
"id": "71ee90ff616bd2e4058ef134287d1dcbb19eec611496beb07c0cf6351ab33182",
"url": "https://osv.dev/vulnerability/RUSTSEC-2025-0001",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "gix-worktree-state nonexclusive checkout sets executable files world-writable",
"summary": "### Summary `gix-worktree-state` specifies 0777 permissions when checking out executable files, intending that the umask will restrict them appropriately. But one of the strategies it uses to set permissions is not subject to the umask. This causes files in a repository to be world-writable in some situations. ### Details Git repositories track executable bits for regular files. In tree objects and the index, regular file modes are stored as 0644 if not executable, or 0755 if executable. But this is independent of how the permissions are set in the filesystem (where supported). [`gix_worktree_state::checkout`](https://github.com/GitoxideLabs/gitoxide/blob/8d84818240d44e1f5fe78a231b5d9bffd0283918/gix-worktree-state/src/checkout/function.rs#L8-L35) has two strategies for checking out a file and marking it executable on a Unix-like operating system, one of which is vulnerable: - If the file is created by assuming it does not already exist, correct permissions are applied, because permissions specified when opening a file are subject to the umask. - If the file is considered possibly already to exist—even in a clean checkout if the application does not specify the option to treat the destination directory as empty—then permissions conferring unrestricted access to any user account on the system are wrongly applied, because permissions specified when calling chmod on an existing file are not subject to the umask. Specifically, [`checkout::entry::checkout`](https://github.com/Gitox",
"evidence": "osv:RUSTSEC-2025-0001",
"products": [
{
"name": {
"value": "gix-worktree-state",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.17.0",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "RUSTSEC-2025-0001",
"aliases": [
"CVE-2025-22620",
"GHSA-fqmf-w4xh-33rh",
"RUSTSEC-2025-0001"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N"
}
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "0.17.0"
}
]
}
],
"package": {
"name": "gix-worktree-state",
"purl": "pkg:cargo/gix-worktree-state",
"ecosystem": "crates.io"
},
"database_specific": {
"cvss": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N",
"source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2025-0001.json",
"categories": [],
"informational": null
},
"ecosystem_specific": {
"affects": {
"os": [],
"arch": [],
"functions": [
"gix_worktree_state::checkout"
]
},
"affected_functions": null
}
}
],
"modified": "2026-10-12T18:00:13.046302101Z",
"provider": "osv",
"references": [
"https://crates.io/crates/gix-worktree-state",
"https://rustsec.org/advisories/RUSTSEC-2025-0001.html",
"https://github.com/GitoxideLabs/gitoxide/pull/1764",
"https://github.com/advisories/GHSA-fqmf-w4xh-33rh",
"https://nvd.nist.gov/vuln/detail/CVE-2025-22620"
],
"provider_metadata": {
"license": "CC0-1.0"
}
},
"related_cves": [
{
"value": "CVE-2025-22620",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 306435,
"published_at": "2025-01-18T12:00:00+00:00"
}