Catégories
CVE-2025-22620

gix-worktree-state nonexclusive checkout sets executable files world-writable

Résumé

gix-worktree-state nonexclusive checkout sets executable files world-writable

Description d'origine

La description telle que publiée par la source (souvent en anglais).

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 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.co…

Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV

Paquets affectés

crates.io gix-worktree-state
[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.17.0"}]}]

État des correctifs par distribution

Paquets corrigés publiés par chaque distribution pour cette CVE

Références

Nous utilisons des cookies pour l'analyse d'audience et la mesure publicitaire. Ce réglage s'applique à tous les sites de Game co., Ltd. En savoir plus