Skip to content

Commit 2ad30aa

Browse files
authored
Merge pull request progit#1840 from Volker-Weissmann/main
Added warning about the insecurity of git://
2 parents f43e104 + f3c73a0 commit 2ad30aa

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

book/01-introduction/sections/installing.asc

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,5 @@ After this is done, you can also get Git via Git itself for updates:
133133

134134
[source,console]
135135
----
136-
$ git clone git://git.kernel.org/pub/scm/git/git.git
136+
$ git clone https://git.kernel.org/pub/scm/git/git.git
137137
----

book/02-git-basics/sections/viewing-history.asc

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ This option adds a nice little ASCII graph showing your branch and merge history
191191
----
192192
$ git log --pretty=format:"%h %s" --graph
193193
* 2d3acf9 Ignore errors from SIGCHLD on trap
194-
* 5e3ee11 Merge branch 'master' of git://github.com/dustin/grit
194+
* 5e3ee11 Merge branch 'master' of https://github.com/dustin/grit.git
195195
|\
196196
| * 420eac9 Add method for getting the current branch
197197
* | 30e367c Timeout code and tests

book/04-git-server/sections/gitweb.asc

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ First, you need to get the Git source code, which GitWeb comes with, and generat
3636

3737
[source,console]
3838
----
39-
$ git clone git://git.kernel.org/pub/scm/git/git.git
39+
$ git clone https://git.kernel.org/pub/scm/git/git.git
4040
$ cd git/
4141
$ make GITWEB_PROJECTROOT="/srv/git" prefix=/usr gitweb
4242
SUBDIR gitweb

book/04-git-server/sections/protocols.asc

+9-4
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ If you want to allow anonymous read-only access to your projects and also want t
181181

182182
(((protocols, git)))
183183
Finally, we have the Git protocol.
184-
This is a special daemon that comes packaged with Git; it listens on a dedicated port (9418) that provides a service similar to the SSH protocol, but with absolutely no authentication.
184+
This is a special daemon that comes packaged with Git; it listens on a dedicated port (9418) that provides a service similar to the SSH protocol, but with absolutely no authentication or cryptography.
185185
In order for a repository to be served over the Git protocol, you must create a `git-daemon-export-ok` file -- the daemon won't serve a repository without that file in it -- but, other than that, there is no security.
186186
Either the Git repository is available for everyone to clone, or it isn't.
187187
This means that there is generally no pushing over this protocol.
@@ -196,9 +196,14 @@ It uses the same data-transfer mechanism as the SSH protocol but without the enc
196196

197197
===== The Cons
198198

199-
The downside of the Git protocol is the lack of authentication.
200-
It's generally undesirable for the Git protocol to be the only access to your project.
201-
Generally, you'll pair it with SSH or HTTPS access for the few developers who have push (write) access and have everyone else use `git://` for read-only access.
199+
Due to the lack of TLS or other cryptography, cloning over `git://` might lead to an arbitrary code execution vulnerability, and should therefore be avoided unless you know what you are doing.
200+
201+
* If you run `git clone git://example.com/project.git`, an attacker who controls e.g your router can modify the repo you just cloned, inserting malicious code into it. If you then compile/run the code you just cloned, you will execute the malicious code.
202+
Running `git clone http://example.com/project.git` should be avoided for the same reason.
203+
* Running `git clone https://example.com/project.git` does not suffer from the same problem (unless the attacker can provide a TLS certificate for example.com).
204+
Running `git clone [email protected]:project.git` only suffers from this problem if you accept a wrong ssh key fingerprint.
205+
206+
It also has no authentication, i.e. anyone can clone the repo (although this is often exactly what you want).
202207
It's also probably the most difficult protocol to set up.
203208
It must run its own daemon, which requires `xinetd` or `systemd` configuration or the like, which isn't always a walk in the park.
204209
It also requires firewall access to port 9418, which isn't a standard port that corporate firewalls always allow.

book/05-distributed-git/sections/contributing.asc

+1-1
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ Jessica Smith (1):
561561
562562
are available in the git repository at:
563563
564-
git://githost/simplegit.git featureA
564+
https://githost/simplegit.git featureA
565565
566566
Jessica Smith (2):
567567
Add limit to log function

book/05-distributed-git/sections/maintaining.asc

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ For instance, if Jessica sends you an email saying that she has a great new feat
191191

192192
[source,console]
193193
----
194-
$ git remote add jessica git://github.com/jessica/myproject.git
194+
$ git remote add jessica https://github.com/jessica/myproject.git
195195
$ git fetch jessica
196196
$ git checkout -b rubyclient jessica/ruby-client
197197
----

0 commit comments

Comments
 (0)