Skip to content

Validate repository directory ownership (v1.4) - #6267

Merged
ethomson merged 8 commits into
maint/v1.4from
ethomson/ownership_14
Apr 12, 2022
Merged

Validate repository directory ownership (v1.4)#6267
ethomson merged 8 commits into
maint/v1.4from
ethomson/ownership_14

Conversation

@ethomson

Copy link
Copy Markdown
Member

Backport of #6266 to the v1.4 branch.

Provide individual file ownership checks for both the current user and
the system user, as well as a combined current user and system user
check.
Ensure that the repository directory is owned by the current user; this
prevents us from opening configuration files that may have been created
by an attacker.
Provide a mock for file ownership for testability.
Test that we prevent opening directories that are not owned by
ourselves.
Pull the global configuration loader out of the symlink check so that it
can be re-used.
Obey the `safe.directory` configuration variable if it is set in the
global or system configuration. (Do not try to load this from the
repository configuration - to avoid malicious repositories that then
mark themselves as safe.)
Introduce the `GIT_OPT_SET_OWNER_VALIDATION` option, so that users can
disable repository ownership validation.
@ethomson
ethomson merged commit 8bc1f0d into maint/v1.4 Apr 12, 2022
@ethomson
ethomson deleted the ethomson/ownership_14 branch April 12, 2022 18:16
@ethomson ethomson added the v1.4 label Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant