Closed jwilk closed 7 years ago
Nearly-identical bug in a different codebase: https://github.com/sociomantic-tsunami/git-hub/issues/197
Same applies to data received from gitlab/bitbucket, and such data is used in other places as well. Probably worth trying to find more places where extra '--' are needed. Not sure if I agree with the url validation though. We don't validate other data returned by github either.
With aeeb2d496859419ac1ba1da1162d6f3610f7f1f3 in git.git, this no longer is an issue for clone.
When you ask
git hub
to clone a repository, it will call:where both repourl and reponame come from GitHub API, without any sanitization. Operators of the GitHub server could exploit it for directory traversal or, more excitingly, for arbitrary code execution, either via option injection, e.g.:
or more directly with git-remote-ext, e.g.:
With Python before 2.7.9, which didn't verify certificates by default, this bug could be also exploited by man-in-the-middle attackers.