git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ANNOUNCE] GIT 1.6.0.6
@ 2008-12-20  6:40 Junio C Hamano
  2008-12-20  6:46 ` [Security] gitweb local privilege escalation (fix) Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2008-12-20  6:40 UTC (permalink / raw)
  To: git; +Cc: linux-kernel

The latest maintenance release GIT 1.6.0.6 is available at the
usual places:

  http://www.kernel.org/pub/software/scm/git/

  git-1.6.0.6.tar.{gz,bz2}			(source tarball)
  git-htmldocs-1.6.0.6.tar.{gz,bz2}		(preformatted docs)
  git-manpages-1.6.0.6.tar.{gz,bz2}		(preformatted docs)

The RPM binary packages for a few architectures are also provided
as courtesy.

  RPMS/$arch/git-*-1.6.0.6-1.fc9.$arch.rpm	(RPM)

Among miscellaneous fixes, this contains a local gitweb security fix.
Maintenance releases for older versions (v1.5.4.7, v1.5.5.6 and v1.5.6.6)
are also available at the same place.

----------------------------------------------------------------

Changes since v1.6.0.5 are as follows:

David Aguilar (1):
      git-mergetool: properly handle "git mergetool -- filename"

Deskin Miller (1):
      git-svn: Make following parents atomic

Jim Meyering (1):
      git-config.txt: fix a typo

Johannes Schindelin (2):
      fast-import: close pack before unlinking it
      fast-export: deal with tag objects that do not have a tagger

Junio C Hamano (6):
      work around Python warnings from AsciiDoc
      git-show: do not segfault when showing a bad tag
      pager: do not dup2 stderr if it is already redirected
      gitweb: do not run "git diff" that is Porcelain
      GIT 1.5.4.7
      fast-import: make tagger information optional

Linus Torvalds (1):
      fsck: reduce stack footprint

Markus Heidelberg (1):
      Documentation: fix typos, grammar, asciidoc syntax

Miklos Vajna (1):
      SubmittingPatches: mention the usage of real name in Signed-off-by: lines

Nicolas Pitre (1):
      make sure packs to be replaced are closed beforehand

Wu Fengguang (1):
      git-send-email: handle email address with quoted comma

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Security] gitweb local privilege escalation (fix)
  2008-12-20  6:40 [ANNOUNCE] GIT 1.6.0.6 Junio C Hamano
@ 2008-12-20  6:46 ` Junio C Hamano
  2008-12-20 10:54   ` Jakub Narebski
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2008-12-20  6:46 UTC (permalink / raw)
  To: git; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]

Current gitweb has a possible local privilege escalation bug that allows a
malicious repository owner to run a command of his choice by specifying
diff.external configuration variable in his repository and running a
crafted gitweb query.

Recent (post 1.4.3) gitweb itself never generates a link that would result
in such a query, and the safest and cleanest fix to this issue is to
simply drop the support for it.  Maintenance release v1.6.0.6, v1.5.6.6,
v1.5.5.6 and v1.5.4.7 are already available at k.org (see the announcement
for v1.6.0.6 I sent out a few minutes ago), and the master branch and
others pushed out tonight have the same fix.

This message contains two patches (credits go to Matt McCutchen, Jeff King
and Jakub Narebski) to do the fix yourself:

 (1) for Git 1.5.4.X, 1.5.5.X, and 1.5.6.X, and

 (2) for Git 1.6.0.X.

Distro packagers and people on the vendor security list have been notified
about this fix earlier this week; people running gitweb from vendor
supplied binaries should be able to get updates from them as well.


[-- Attachment #2: gitweb hotfix for 1.5.[456].X series --]
[-- Type: text/plain, Size: 2313 bytes --]

>From dfff4b7aa42de7e7d58caeebe2c6128449f09b76 Mon Sep 17 00:00:00 2001
From: Junio C Hamano <gitster@pobox.com>
Date: Tue, 16 Dec 2008 19:42:02 -0800
Subject: [PATCH] gitweb: do not run "git diff" that is Porcelain

Jakub says that legacy-style URI to view two blob differences are never
generated since 1.4.3.  This codepath runs "git diff" Porcelain from the
gitweb, which is a no-no.  It can trigger diff.external command that is
specified in the configuration file of the repository being viewed.

This patch applies to v1.5.4 and later.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 gitweb/gitweb.perl |   38 ++------------------------------------
 1 files changed, 2 insertions(+), 36 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b582332..86a6ced 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4809,43 +4809,9 @@ sub git_blobdiff {
 			or die_error(undef, "Open git-diff-tree failed");
 	}
 
-	# old/legacy style URI
-	if (!%diffinfo && # if new style URI failed
-	    defined $hash && defined $hash_parent) {
-		# fake git-diff-tree raw output
-		$diffinfo{'from_mode'} = $diffinfo{'to_mode'} = "blob";
-		$diffinfo{'from_id'} = $hash_parent;
-		$diffinfo{'to_id'}   = $hash;
-		if (defined $file_name) {
-			if (defined $file_parent) {
-				$diffinfo{'status'} = '2';
-				$diffinfo{'from_file'} = $file_parent;
-				$diffinfo{'to_file'}   = $file_name;
-			} else { # assume not renamed
-				$diffinfo{'status'} = '1';
-				$diffinfo{'from_file'} = $file_name;
-				$diffinfo{'to_file'}   = $file_name;
-			}
-		} else { # no filename given
-			$diffinfo{'status'} = '2';
-			$diffinfo{'from_file'} = $hash_parent;
-			$diffinfo{'to_file'}   = $hash;
-		}
-
-		# non-textual hash id's can be cached
-		if ($hash =~ m/^[0-9a-fA-F]{40}$/ &&
-		    $hash_parent =~ m/^[0-9a-fA-F]{40}$/) {
-			$expires = '+1d';
-		}
-
-		# open patch output
-		open $fd, "-|", git_cmd(), "diff", @diff_opts,
-			'-p', ($format eq 'html' ? "--full-index" : ()),
-			$hash_parent, $hash, "--"
-			or die_error(undef, "Open git-diff failed");
-	} else  {
+	# old/legacy style URI -- not generated anymore since 1.4.3.
+	if (!%diffinfo) {
 		die_error('404 Not Found', "Missing one of the blob diff parameters")
-			unless %diffinfo;
 	}
 
 	# header
-- 
1.6.1.rc3.19.g66a9


[-- Attachment #3: gitweb hotfix for 1.6.0.X series --]
[-- Type: text/plain, Size: 1630 bytes --]

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index ced7bb7..804670c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4863,43 +4863,9 @@ sub git_blobdiff {
 			or die_error(500, "Open git-diff-tree failed");
 	}
 
-	# old/legacy style URI
-	if (!%diffinfo && # if new style URI failed
-	    defined $hash && defined $hash_parent) {
-		# fake git-diff-tree raw output
-		$diffinfo{'from_mode'} = $diffinfo{'to_mode'} = "blob";
-		$diffinfo{'from_id'} = $hash_parent;
-		$diffinfo{'to_id'}   = $hash;
-		if (defined $file_name) {
-			if (defined $file_parent) {
-				$diffinfo{'status'} = '2';
-				$diffinfo{'from_file'} = $file_parent;
-				$diffinfo{'to_file'}   = $file_name;
-			} else { # assume not renamed
-				$diffinfo{'status'} = '1';
-				$diffinfo{'from_file'} = $file_name;
-				$diffinfo{'to_file'}   = $file_name;
-			}
-		} else { # no filename given
-			$diffinfo{'status'} = '2';
-			$diffinfo{'from_file'} = $hash_parent;
-			$diffinfo{'to_file'}   = $hash;
-		}
-
-		# non-textual hash id's can be cached
-		if ($hash =~ m/^[0-9a-fA-F]{40}$/ &&
-		    $hash_parent =~ m/^[0-9a-fA-F]{40}$/) {
-			$expires = '+1d';
-		}
-
-		# open patch output
-		open $fd, "-|", git_cmd(), "diff", @diff_opts,
-			'-p', ($format eq 'html' ? "--full-index" : ()),
-			$hash_parent, $hash, "--"
-			or die_error(500, "Open git-diff failed");
-	} else  {
-		die_error(400, "Missing one of the blob diff parameters")
-			unless %diffinfo;
+	# old/legacy style URI -- not generated anymore since 1.4.3.
+	if (!%diffinfo) {
+		die_error('404 Not Found', "Missing one of the blob diff parameters")
 	}
 
 	# header

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Security] gitweb local privilege escalation (fix)
  2008-12-20  6:46 ` [Security] gitweb local privilege escalation (fix) Junio C Hamano
@ 2008-12-20 10:54   ` Jakub Narebski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Narebski @ 2008-12-20 10:54 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, linux-kernel

Junio C Hamano <gitster@pobox.com> writes:

> Current gitweb has a possible local privilege escalation bug that allows a
> malicious repository owner to run a command of his choice by specifying
> diff.external configuration variable in his repository and running a
> crafted gitweb query.
> 
> Recent (post 1.4.3) gitweb itself never generates a link that would result
> in such a query, and the safest and cleanest fix to this issue is to
> simply drop the support for it.  Maintenance release v1.6.0.6, v1.5.6.6,
> v1.5.5.6 and v1.5.4.7 are already available at k.org (see the announcement
> for v1.6.0.6 I sent out a few minutes ago), and the master branch and
> others pushed out tonight have the same fix.

>From what I have found diff.external works only since v1.5.4 (see
commit cbe02100), so when gitweb started using git-diff for old
legacy links to not use $tmpdir and /usr/bin/diff -u it wasn't an
issue...

-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Security] gitweb local privilege escalation (fix)
@ 2008-12-20 11:26 Nanako Shiraishi
  0 siblings, 0 replies; 4+ messages in thread
From: Nanako Shiraishi @ 2008-12-20 11:26 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git, linux-kernel

Quoting Jakub Narebski <jnareb@gmail.com>:

> Junio C Hamano <gitster@pobox.com> writes:
>
>> Current gitweb has a possible local privilege escalation bug that allows a
>> malicious repository owner to run a command of his choice by specifying
>> diff.external configuration variable in his repository and running a
>> crafted gitweb query.
>> 
>> Recent (post 1.4.3) gitweb itself never generates a link that would result
>> in such a query, and the safest and cleanest fix to this issue is to
>> simply drop the support for it.  Maintenance release v1.6.0.6, v1.5.6.6,
>> v1.5.5.6 and v1.5.4.7 are already available at k.org (see the announcement
>> for v1.6.0.6 I sent out a few minutes ago), and the master branch and
>> others pushed out tonight have the same fix.
>
> From what I have found diff.external works only since v1.5.4 (see
> commit cbe02100), so when gitweb started using git-diff for old
> legacy links to not use $tmpdir and /usr/bin/diff -u it wasn't an
> issue...

Sorry, but I do not understand what you are trying to say.

The maintenance releases Junio listed above go only as far back as v1.5.4.X series, so it covers the necessary range of versions, and no further back than that.  Do you see a problem with that?

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-20 11:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-20  6:40 [ANNOUNCE] GIT 1.6.0.6 Junio C Hamano
2008-12-20  6:46 ` [Security] gitweb local privilege escalation (fix) Junio C Hamano
2008-12-20 10:54   ` Jakub Narebski
  -- strict thread matches above, loose matches on Subject: below --
2008-12-20 11:26 Nanako Shiraishi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).