diff options
author | Jeff King <peff@peff.net> | 2015-09-16 13:13:12 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-23 11:35:48 -0700 |
commit | 33cfccbbf35a56e190b79bdec5c85457c952a021 (patch) | |
tree | 1b94b1eff66ebbc258722f59b60ca64eac0c6de3 /pathspec.c | |
parent | transport: add a protocol-whitelist environment variable (diff) | |
download | tgif-33cfccbbf35a56e190b79bdec5c85457c952a021.tar.xz |
submodule: allow only certain protocols for submodule fetches
Some protocols (like git-remote-ext) can execute arbitrary
code found in the URL. The URLs that submodules use may come
from arbitrary sources (e.g., .gitmodules files in a remote
repository). Let's restrict submodules to fetching from a
known-good subset of protocols.
Note that we apply this restriction to all submodule
commands, whether the URL comes from .gitmodules or not.
This is more restrictive than we need to be; for example, in
the tests we run:
git submodule add ext::...
which should be trusted, as the URL comes directly from the
command line provided by the user. But doing it this way is
simpler, and makes it much less likely that we would miss a
case. And since such protocols should be an exception
(especially because nobody who clones from them will be able
to update the submodules!), it's not likely to inconvenience
anyone in practice.
Reported-by: Blake Burkhart <bburky@bburky.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pathspec.c')
0 files changed, 0 insertions, 0 deletions