Validate repository directory ownership (v1.3)#6268
Merged
ethomson merged 9 commits intomaint/v1.3from Apr 12, 2022
Merged
Conversation
GitHub is removing support for the unauthenticated git protocol; test with the https protocol.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #6266 to the v1.3 branch.