<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/http.h, branch v2.18.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.18.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.18.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-05-30T12:51:28Z</updated>
<entry>
<title>Merge branch 'jk/snprintf-truncation'</title>
<updated>2018-05-30T12:51:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-30T12:51:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7c3d15fe3113cf48db60656eedd152c46f47bf6b'/>
<id>urn:sha1:7c3d15fe3113cf48db60656eedd152c46f47bf6b</id>
<content type='text'>
Avoid unchecked snprintf() to make future code auditing easier.

* jk/snprintf-truncation:
  fmt_with_err: add a comment that truncation is OK
  shorten_unambiguous_ref: use xsnprintf
  fsmonitor: use internal argv_array of struct child_process
  log_write_email_headers: use strbufs
  http: use strbufs instead of fixed buffers
</content>
</entry>
<entry>
<title>http: use strbufs instead of fixed buffers</title>
<updated>2018-05-21T00:54:30Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-05-19T01:56:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=390c6cbc5e643b6d89869b319b51b5b62a3f5a09'/>
<id>urn:sha1:390c6cbc5e643b6d89869b319b51b5b62a3f5a09</id>
<content type='text'>
We keep the names of incoming packs and objects in fixed
PATH_MAX-size buffers, and snprintf() into them. This is
unlikely to end up with truncated filenames, but it is
possible (especially on systems where PATH_MAX is shorter
than actual paths can be). Let's switch to using strbufs,
which makes the question go away entirely.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: allow providing extra headers for http requests</title>
<updated>2018-03-15T19:01:09Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2018-03-15T17:31:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8ff14ed4127decbee3116aba59d7f8f897c4fe3b'/>
<id>urn:sha1:8ff14ed4127decbee3116aba59d7f8f897c4fe3b</id>
<content type='text'>
Add a way for callers to request that extra headers be included when
making http requests.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http.postbuffer: allow full range of ssize_t values</title>
<updated>2017-04-14T01:24:32Z</updated>
<author>
<name>David Turner</name>
<email>dturner@twosigma.com</email>
</author>
<published>2017-04-11T18:13:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=37ee680d9b90fe4c4fc5be4e14f17baf49f6ce59'/>
<id>urn:sha1:37ee680d9b90fe4c4fc5be4e14f17baf49f6ce59</id>
<content type='text'>
Unfortunately, in order to push some large repos where a server does
not support chunked encoding, the http postbuffer must sometimes
exceed two gigabytes.  On a 64-bit system, this is OK: we just malloc
a larger buffer.

This means that we need to use CURLOPT_POSTFIELDSIZE_LARGE to set the
buffer size.

Signed-off-by: David Turner &lt;dturner@twosigma.com&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/http-walker-limit-redirect-2.9'</title>
<updated>2016-12-19T22:45:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-12-19T22:45:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8a2882f23ecce3a8742743555a408e508d4db806'/>
<id>urn:sha1:8a2882f23ecce3a8742743555a408e508d4db806</id>
<content type='text'>
Transport with dumb http can be fooled into following foreign URLs
that the end user does not intend to, especially with the server
side redirects and http-alternates mechanism, which can lead to
security issues.  Tighten the redirection and make it more obvious
to the end user when it happens.

* jk/http-walker-limit-redirect-2.9:
  http: treat http-alternates like redirects
  http: make redirects more obvious
  remote-curl: rename shadowed options variable
  http: always update the base URL for redirects
  http: simplify update_url_from_redirect
</content>
</entry>
<entry>
<title>http: make redirects more obvious</title>
<updated>2016-12-06T20:32:48Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-12-06T18:24:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50d3413740d1da599cdc0106e6e916741394cc98'/>
<id>urn:sha1:50d3413740d1da599cdc0106e6e916741394cc98</id>
<content type='text'>
We instruct curl to always follow HTTP redirects. This is
convenient, but it creates opportunities for malicious
servers to create confusing situations. For instance,
imagine Alice is a git user with access to a private
repository on Bob's server. Mallory runs her own server and
wants to access objects from Bob's repository.

Mallory may try a few tricks that involve asking Alice to
clone from her, build on top, and then push the result:

  1. Mallory may simply redirect all fetch requests to Bob's
     server. Git will transparently follow those redirects
     and fetch Bob's history, which Alice may believe she
     got from Mallory. The subsequent push seems like it is
     just feeding Mallory back her own objects, but is
     actually leaking Bob's objects. There is nothing in
     git's output to indicate that Bob's repository was
     involved at all.

     The downside (for Mallory) of this attack is that Alice
     will have received Bob's entire repository, and is
     likely to notice that when building on top of it.

  2. If Mallory happens to know the sha1 of some object X in
     Bob's repository, she can instead build her own history
     that references that object. She then runs a dumb http
     server, and Alice's client will fetch each object
     individually. When it asks for X, Mallory redirects her
     to Bob's server. The end result is that Alice obtains
     objects from Bob, but they may be buried deep in
     history. Alice is less likely to notice.

Both of these attacks are fairly hard to pull off. There's a
social component in getting Mallory to convince Alice to
work with her. Alice may be prompted for credentials in
accessing Bob's repository (but not always, if she is using
a credential helper that caches). Attack (1) requires a
certain amount of obliviousness on Alice's part while making
a new commit. Attack (2) requires that Mallory knows a sha1
in Bob's repository, that Bob's server supports dumb http,
and that the object in question is loose on Bob's server.

But we can probably make things a bit more obvious without
any loss of functionality. This patch does two things to
that end.

First, when we encounter a whole-repo redirect during the
initial ref discovery, we now inform the user on stderr,
making attack (1) much more obvious.

Second, the decision to follow redirects is now
configurable. The truly paranoid can set the new
http.followRedirects to false to avoid any redirection
entirely. But for a more practical default, we will disallow
redirects only after the initial ref discovery. This is
enough to thwart attacks similar to (2), while still
allowing the common use of redirects at the repository
level. Since c93c92f30 (http: update base URLs when we see
redirects, 2013-09-28) we re-root all further requests from
the redirect destination, which should generally mean that
no further redirection is necessary.

As an escape hatch, in case there really is a server that
needs to redirect individual requests, the user can set
http.followRedirects to "true" (and this can be done on a
per-server basis via http.*.followRedirects config).

Reported-by: Jann Horn &lt;jannh@google.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ep/http-curl-trace'</title>
<updated>2016-07-06T20:38:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-06T20:38:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2f84df2ca0f7a5174d2eb5f4ee52324ce8f807b9'/>
<id>urn:sha1:2f84df2ca0f7a5174d2eb5f4ee52324ce8f807b9</id>
<content type='text'>
HTTP transport gained an option to produce more detailed debugging
trace.

* ep/http-curl-trace:
  imap-send.c: introduce the GIT_TRACE_CURL enviroment variable
  http.c: implement the GIT_TRACE_CURL environment variable
</content>
</entry>
<entry>
<title>http.c: implement the GIT_TRACE_CURL environment variable</title>
<updated>2016-05-24T22:48:18Z</updated>
<author>
<name>Elia Pinto</name>
<email>gitter.spiros@gmail.com</email>
</author>
<published>2016-05-23T13:44:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=74c682d3c63bff8860af5caf9bd38a5413568709'/>
<id>urn:sha1:74c682d3c63bff8860af5caf9bd38a5413568709</id>
<content type='text'>
Implement the GIT_TRACE_CURL environment variable to allow a
greater degree of detail of GIT_CURL_VERBOSE, in particular
the complete transport header and all the data payload exchanged.
It might be useful if a particular situation could require a more
thorough debugging analysis. Document the new GIT_TRACE_CURL
environment variable.

Helped-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Helped-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.com&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Elia Pinto &lt;gitter.spiros@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: support sending custom HTTP headers</title>
<updated>2016-04-27T21:02:33Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-04-27T12:20:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8cb01e2fd3a50b6d0893dfb066183f16a3c7a355'/>
<id>urn:sha1:8cb01e2fd3a50b6d0893dfb066183f16a3c7a355</id>
<content type='text'>
We introduce a way to send custom HTTP headers with all requests.

This allows us, for example, to send an extra token from build agents
for temporary access to private repositories. (This is the use case that
triggered this patch.)

This feature can be used like this:

	git -c http.extraheader='Secret: sssh!' fetch $URL $REF

Note that `curl_easy_setopt(..., CURLOPT_HTTPHEADER, ...)` takes only
a single list, overriding any previous call. This means we have to
collect _all_ of the headers we want to use into a single list, and
feed it to cURL in one shot. Since we already unconditionally set a
"pragma" header when initializing the curl handles, we can add our new
headers to that list.

For callers which override the default header list (like probe_rpc),
we provide `http_copy_default_headers()` so they can do the same
trick.

Big thanks to Jeff King and Junio Hamano for their outstanding help and
patient reviews.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ew/force-ipv4'</title>
<updated>2016-02-24T21:25:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-24T21:25:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e84d5e9fa178a027b1c8b9f6e22c9173dcda03b3'/>
<id>urn:sha1:e84d5e9fa178a027b1c8b9f6e22c9173dcda03b3</id>
<content type='text'>
"git fetch" and friends that make network connections can now be
told to only use ipv4 (or ipv6).

* ew/force-ipv4:
  connect &amp; http: support -4 and -6 switches for remote operations
</content>
</entry>
</feed>
