8d1a744820
There is a known social engineering attack that takes advantage of the fact that a working tree can include an entire bare repository, including a config file. A user could run a Git command inside the bare repository thinking that the config file of the 'outer' repository would be used, but in reality, the bare repository's config file (which is attacker-controlled) is used, which may result in arbitrary code execution. See [1] for a fuller description and deeper discussion. A simple mitigation is to forbid bare repositories unless specified via `--git-dir` or `GIT_DIR`. In environments that don't use bare repositories, this would be minimally disruptive. Create a config variable, `safe.bareRepository`, that tells Git whether or not to die() when working with a bare repository. This config is an enum of: - "all": allow all bare repositories (this is the default) - "explicit": only allow bare repositories specified via --git-dir or GIT_DIR. If we want to protect users from such attacks by default, neither value will suffice - "all" provides no protection, but "explicit" is impractical for bare repository users. A more usable default would be to allow only non-embedded bare repositories ([2] contains one such proposal), but detecting if a repository is embedded is potentially non-trivial, so this work is not implemented in this series. [1]: https://lore.kernel.org/git/kl6lsfqpygsj.fsf@chooglen-macbookpro.roam.corp.google.com [2]: https://lore.kernel.org/git/5b969c5e-e802-c447-ad25-6acc0b784582@github.com Signed-off-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
---|---|---|
.. | ||
add.txt | ||
advice.txt | ||
alias.txt | ||
am.txt | ||
apply.txt | ||
blame.txt | ||
branch.txt | ||
browser.txt | ||
checkout.txt | ||
clean.txt | ||
clone.txt | ||
color.txt | ||
column.txt | ||
commit.txt | ||
commitgraph.txt | ||
completion.txt | ||
core.txt | ||
credential.txt | ||
diff.txt | ||
difftool.txt | ||
extensions.txt | ||
fastimport.txt | ||
feature.txt | ||
fetch.txt | ||
filter.txt | ||
fmt-merge-msg.txt | ||
format.txt | ||
fsck.txt | ||
gc.txt | ||
gitcvs.txt | ||
gitweb.txt | ||
gpg.txt | ||
grep.txt | ||
gui.txt | ||
guitool.txt | ||
help.txt | ||
http.txt | ||
i18n.txt | ||
imap.txt | ||
index.txt | ||
init.txt | ||
instaweb.txt | ||
interactive.txt | ||
log.txt | ||
lsrefs.txt | ||
mailinfo.txt | ||
mailmap.txt | ||
maintenance.txt | ||
man.txt | ||
merge.txt | ||
mergetool.txt | ||
notes.txt | ||
pack.txt | ||
pager.txt | ||
pretty.txt | ||
protocol.txt | ||
pull.txt | ||
push.txt | ||
rebase.txt | ||
receive.txt | ||
remote.txt | ||
remotes.txt | ||
repack.txt | ||
rerere.txt | ||
revert.txt | ||
safe.txt | ||
sendemail.txt | ||
sequencer.txt | ||
showbranch.txt | ||
sparse.txt | ||
splitindex.txt | ||
ssh.txt | ||
stash.txt | ||
status.txt | ||
submodule.txt | ||
tag.txt | ||
tar.txt | ||
trace2.txt | ||
transfer.txt | ||
uploadarchive.txt | ||
uploadpack.txt | ||
url.txt | ||
user.txt | ||
versionsort.txt | ||
web.txt | ||
worktree.txt |