SECURITY: safe.directory backport doesn't check key name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
git (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The recent backport of the security fix for CVE-2022-24765 does not contain enough of the upstream fix for the issue. Specifically, it does not contain a subsequent commit that corrects the omission of checking the key name when searching the config file for safe directories.
In the implementation backported to Ubuntu, the config file parser does not check the name of the key when scanning key/value pairs for directories that should be considered as safe. As such, any key whose value looks like a directory name will cause that directory to be treated as safe. (i.e. "foo.bar = /path/to/something" is functionally equivalent to "safe.directory = /path/to/
Upstream commit bb50ec3cc300eef
Another subsequent commit missing from the Ubuntu backport of the fix is one that adds the option to opt-out of safe directory checking by setting the value of "safe.directory" to "*".
The fix as included in Ubuntu introduces a host of regressions for users/sites with large numbers of intentionally shared repositories, repositories in network filesystems where the numeric owner id on a file/directory is not indicative of who actually has access to the repository, or sites where repositories are accessed from within a container where numeric uids differ between the host and the container.
Upstream commit 0f85c4a30b072a2 6d74af8bbf63cc8 f6a5dfc1b8 which introduces the opt-out mechanism to revert the regression is attached.