git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Certificate validation vulnerability in Git

From
Jeff King <peff@peff.net>
Date
Feb 25, 2013, 03:16 UTC
Message-ID
<20130225031648.GA31988@sigill.intra.peff.net>
In-Reply-To
<CAA5xPpmmZuMK7q3-pTOx4L6DxFtyw5HWYdH7kHEsK=96KM5kAQ@mail.gmail.com>
On Sun, Feb 24, 2013 at 11:01:50PM +0530, Zubin Mithra wrote:
Show 21 quoted lines
> There seems to be a security issue in the way git uses openssl for
> certificate validation. Similar occurrences have been found and
> documented in other open source projects, the research can be found at
> [1].
> 
> -=========]
> - imap-send.c
> 
> Line 307
> 
>  307   ret = SSL_connect(sock->ssl);
>  308   if (ret <= 0) {
>  309     socket_perror("SSL_connect", sock, ret);
>  310     return -1;
>  311   }
>  312
> 
> Certificate validation errors are signaled either through return
> values of SSL_connect or by setting internal flags. The internal flags
> need to be checked using the SSL_get_verify_result function. This is
> not performed.

I'm not sure what you mean. We use SSL_CTX_set_verify to turn on peer certificate verification, which will cause SSL_connect to return failure if the certificate signature cannot be traced back to a CA cert from our local store.

Is there some case where this does not happen properly? If so, can you give an example? The paper you referenced says only that there are some special cases where SSL_connect does not notice the error, but then gives an example where the application does not turn on SSL_VERIFY_PEER. But git does. Are there are other cases that SSL_VERIFY_PEER does not handle?

There is a _different_ problem not handled by the code you show above, which is that SSL_connect does not verify that the hostname we connected to matches the signed certificate. But that was fixed already by b62fb07 (imap-send: the subject of SSL certificate must match the host, 2013-02-15), which is in git v1.8.1.4.

-Peff
Previous: Junio C HamanoNext: Zubin Mithra
Message 6 of 7 in “Certificate validation vulnerability in Git”
  1. Zubin MithraFeb 24, 2013
  2. Andreas EricssonFeb 24, 2013
  3. Zubin MithraFeb 25, 2013
  4. Jeff KingFeb 25, 2013
  5. Junio C HamanoFeb 25, 2013
  6. Jeff KingFeb 25, 2013
  7. Zubin MithraFeb 25, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.