diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 6399c1b..0000000 --- a/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bugzilla-3.2.3.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e6ff977 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +bugzilla-3.2.6.tar.gz +/bugzilla-3.2.10.tar.gz diff --git a/Makefile b/Makefile deleted file mode 100644 index c2b3080..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: bugzilla -# $Id$ -NAME := bugzilla -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/README.fedora.bugzilla b/README.fedora.bugzilla index 2611a75..9814898 100644 --- a/README.fedora.bugzilla +++ b/README.fedora.bugzilla @@ -20,6 +20,6 @@ put in place after configuration is done. The first is a daily cron job for statistics collection. This is in the file "cron.daily" and can be enabled by simply copying this file to /etc/cron.daily/bugzilla (or any other file name in the /etc/cron.daily/ directory). The second is the "whine" cron job, -designed to run every 15 minutes. To enable this job, simply coopy the +designed to run every 15 minutes. To enable this job, simply copy the cron.whine file to /etc/cron.d/bugzilla (or any othe filename within the /etc/cron.d/ directory). diff --git a/bugzilla-3.2.10-CVE-2011-2379.patch b/bugzilla-3.2.10-CVE-2011-2379.patch new file mode 100644 index 0000000..047ddba --- /dev/null +++ b/bugzilla-3.2.10-CVE-2011-2379.patch @@ -0,0 +1,240 @@ +=== modified file 'Bugzilla/Attachment/PatchReader.pm' +--- Bugzilla/Attachment/PatchReader.pm 2008-06-29 22:35:28 +0000 ++++ Bugzilla/Attachment/PatchReader.pm 2011-07-07 06:04:15 +0000 +@@ -37,6 +37,7 @@ + $last_reader->sends_data_to(new PatchReader::DiffPrinter::raw()); + # Actually print out the patch. + print $cgi->header(-type => 'text/plain', ++ -x_content_type_options => "nosniff", + -expires => '+3M'); + disable_utf8(); + $reader->iterate_string('Attachment ' . $attachment->id, $attachment->data); +@@ -118,6 +119,7 @@ + $last_reader->sends_data_to(new PatchReader::DiffPrinter::raw()); + # Actually print out the patch. + print $cgi->header(-type => 'text/plain', ++ -x_content_type_options => "nosniff", + -expires => '+3M'); + disable_utf8(); + } + +=== modified file 'attachment.cgi' +--- attachment.cgi 2009-09-30 08:53:25 +0000 ++++ attachment.cgi 2011-07-21 06:21:26 +0000 +@@ -71,10 +71,13 @@ + + # Determine whether to use the action specified by the user or the default. + my $action = $cgi->param('action') || 'view'; ++my $format = $cgi->param('format') || ''; + + # You must use the appropriate urlbase/sslbase param when doing anything +-# but viewing an attachment. +-if ($action ne 'view') { ++# but viewing an attachment, or a raw diff. ++if ($action ne 'view' ++ && (($action !~ /^(?:interdiff|diff)$/) || $format ne 'raw')) ++{ + my $urlbase = Bugzilla->params->{'urlbase'}; + my $sslbase = Bugzilla->params->{'sslbase'}; + my $path_regexp = $sslbase ? qr/^(\Q$urlbase\E|\Q$sslbase\E)/ : qr/^\Q$urlbase\E/; +@@ -172,7 +175,8 @@ + # non-natural, so use the original value from $cgi in our exception + # message here. + detaint_natural($attach_id) +- || ThrowUserError("invalid_attach_id", { attach_id => $cgi->param($param) }); ++ || ThrowUserError("invalid_attach_id", ++ { attach_id => scalar $cgi->param($param) }); + + # Make sure the attachment exists in the database. + my $attachment = Bugzilla::Attachment->get($attach_id) +@@ -249,53 +253,71 @@ + { bug_id => $bugid }); + } + +-################################################################################ +-# Functions +-################################################################################ ++# Gets the attachment object(s) generated by validateID, while ensuring ++# attachbase and token authentication is used when required. ++sub get_attachment { ++ my @field_names = @_ ? @_ : qw(id); + +-# Display an attachment. +-sub view { +- my $attachment; ++ my %attachments; + + if (use_attachbase()) { +- $attachment = validateID(undef, 1); +- # Replace %bugid% by the ID of the bug the attachment belongs to, if present. ++ # Load each attachment, and ensure they are all from the same bug ++ my $bug_id = 0; ++ foreach my $field_name (@field_names) { ++ my $attachment = validateID($field_name, 1); ++ if (!$bug_id) { ++ $bug_id = $attachment->bug_id; ++ } elsif ($attachment->bug_id != $bug_id) { ++ ThrowUserError('attachment_bug_id_mismatch'); ++ } ++ $attachments{$field_name} = $attachment; ++ } + my $attachbase = Bugzilla->params->{'attachment_base'}; +- my $bug_id = $attachment->bug_id; + $attachbase =~ s/%bugid%/$bug_id/; +- my $path = 'attachment.cgi?id=' . $attachment->id; +- # The user is allowed to override the content type of the attachment. +- if (defined $cgi->param('content_type')) { +- $path .= '&content_type=' . url_quote($cgi->param('content_type')); +- } ++ my @args = map { $_ . '=' . $attachments{$_}->id } @field_names; ++ my $cgi_params = $cgi->canonicalise_query(@field_names, 't', ++ 'Bugzilla_login', 'Bugzilla_password'); ++ push(@args, $cgi_params) if $cgi_params; ++ my $path = 'attachment.cgi?' . join('&', @args); + + # Make sure the attachment is served from the correct server. + if ($cgi->self_url !~ /^\Q$attachbase\E/) { + # We couldn't call Bugzilla->login earlier as we first had to make sure + # we were not going to request credentials on the alternate host. + Bugzilla->login(); +- if (attachmentIsPublic($attachment)) { ++ if (all_attachments_are_public(\%attachments)) { + # No need for a token; redirect to attachment base. + print $cgi->redirect(-location => $attachbase . $path); + exit; + } else { + # Make sure the user can view the attachment. +- check_can_access($attachment); ++ foreach my $field_name (@field_names) { ++ check_can_access($attachments{$field_name}); ++ } + # Create a token and redirect. +- my $token = url_quote(issue_session_token($attachment->id)); ++ my $token = url_quote(issue_session_token(pack_token_data(\%attachments))); + print $cgi->redirect(-location => $attachbase . "$path&t=$token"); + exit; + } + } else { + # No need to validate the token for public attachments. We cannot request + # credentials as we are on the alternate host. +- if (!attachmentIsPublic($attachment)) { ++ if (!all_attachments_are_public(\%attachments)) { + my $token = $cgi->param('t'); +- my ($userid, undef, $token_attach_id) = Bugzilla::Token::GetTokenData($token); +- unless ($userid +- && detaint_natural($token_attach_id) +- && ($token_attach_id == $attachment->id)) +- { ++ my ($userid, undef, $token_data) = Bugzilla::Token::GetTokenData($token); ++ my %token_data = unpack_token_data($token_data); ++ my $valid_token = 1; ++ foreach my $field_name (@field_names) { ++ my $token_id = $token_data{$field_name}; ++ if (!$token_id ++ || !detaint_natural($token_id) ++ || $attachments{$field_name}->id != $token_id) ++ { ++ $valid_token = 0; ++ last; ++ } ++ } ++ unless ($userid && $valid_token) { + # Not a valid token. + print $cgi->redirect('-location' => correct_urlbase() . $path); + exit; +@@ -309,8 +331,48 @@ + } else { + # No alternate host is used. Request credentials if required. + Bugzilla->login(); +- $attachment = validateID(); +- } ++ foreach my $field_name (@field_names) { ++ $attachments{$field_name} = validateID($field_name); ++ } ++ } ++ ++ return wantarray ++ ? map { $attachments{$_} } @field_names ++ : $attachments{$field_names[0]}; ++} ++ ++sub all_attachments_are_public { ++ my $attachments = shift; ++ foreach my $field_name (keys %$attachments) { ++ if (!attachmentIsPublic($attachments->{$field_name})) { ++ return 0; ++ } ++ } ++ return 1; ++} ++ ++sub pack_token_data { ++ my $attachments = shift; ++ return join(' ', map { $_ . '=' . $attachments->{$_}->id } keys %$attachments); ++} ++ ++sub unpack_token_data { ++ my @token_data = split(/ /, shift || ''); ++ my %data; ++ foreach my $token (@token_data) { ++ my ($field_name, $attach_id) = split('=', $token); ++ $data{$field_name} = $attach_id; ++ } ++ return %data; ++} ++ ++################################################################################ ++# Functions ++################################################################################ ++ ++# Display an attachment. ++sub view { ++ my $attachment = get_attachment(); + + # At this point, Bugzilla->login has been called if it had to. + my $contenttype = $attachment->contenttype; +@@ -345,9 +407,14 @@ + + sub interdiff { + # Retrieve and validate parameters +- my $old_attachment = validateID('oldid'); +- my $new_attachment = validateID('newid'); + my $format = validateFormat('html', 'raw'); ++ my($old_attachment, $new_attachment); ++ if ($format eq 'raw') { ++ ($old_attachment, $new_attachment) = get_attachment('oldid', 'newid'); ++ } else { ++ $old_attachment = validateID('oldid'); ++ $new_attachment = validateID('newid'); ++ } + my $context = validateContext(); + + Bugzilla::Attachment::PatchReader::process_interdiff( +@@ -356,8 +423,8 @@ + + sub diff { + # Retrieve and validate parameters +- my $attachment = validateID(); + my $format = validateFormat('html', 'raw'); ++ my $attachment = $format eq 'raw' ? get_attachment() : validateID(); + my $context = validateContext(); + + # If it is not a patch, view normally. + +=== modified file 'contrib/fixperms.pl' (properties changed: -x to +x) +=== modified file 'template/en/default/global/user-error.html.tmpl' +--- template/en/default/global/user-error.html.tmpl 2010-11-02 23:12:13 +0000 ++++ template/en/default/global/user-error.html.tmpl 2011-07-07 06:04:15 +0000 +@@ -102,6 +102,11 @@ + [% terms.Bug %] aliases cannot be longer than 20 characters. + Please choose a shorter alias. + ++ [% ELSIF error == "attachment_bug_id_mismatch" %] ++ [% title = "Invalid Attachments" %] ++ You tried to perform an action on attachments from different [% terms.bugs %]. ++ This operation requires all attachments to be from the same [% terms.bug %]. ++ + [% ELSIF error == "auth_cant_create_account" %] + [% title = "Can't create accounts" %] + This site is using an authentication scheme which does not permit + diff --git a/bugzilla-3.2.10-CVE-2011-2380.patch b/bugzilla-3.2.10-CVE-2011-2380.patch new file mode 100644 index 0000000..af94665 --- /dev/null +++ b/bugzilla-3.2.10-CVE-2011-2380.patch @@ -0,0 +1,28 @@ +=== modified file 'Bugzilla/Bug.pm' +--- Bugzilla/Bug.pm 2010-10-28 15:27:58 +0000 ++++ Bugzilla/Bug.pm 2011-08-01 21:28:07 +0000 +@@ -1403,7 +1403,7 @@ + || ThrowUserError("invalid_group_ID"); + + # This can only happen if somebody hacked the enter_bug form. +- ThrowCodeError("inactive_group", { name => $group->name }) ++ ThrowCodeError("inactive_group", { group_id => $id }) + unless $group->is_active; + + my $membercontrol = $controls->{$id} + +=== modified file 'template/en/default/global/code-error.html.tmpl' +--- template/en/default/global/code-error.html.tmpl 2010-12-30 16:50:29 +0000 ++++ template/en/default/global/code-error.html.tmpl 2011-08-01 21:29:11 +0000 +@@ -217,8 +217,8 @@ + A legal [% field FILTER html %] was not set. + + [% ELSIF error == "inactive_group" %] +- Attempted to add [% terms.bug %] to the '[% name FILTER html %]' +- group, which is not used for [% terms.bugs %]. ++ Attempted to add [% terms.abug %] to group ID [% group_id FILTER html %], ++ which is not used for [% terms.bugs %]. + + [% ELSIF error == "invalid_attach_id_to_obsolete" %] + The attachment number of one of the attachments you wanted to obsolete, + diff --git a/bugzilla-3.2.10-CVE-2011-2381.patch b/bugzilla-3.2.10-CVE-2011-2381.patch new file mode 100644 index 0000000..0d64a00 --- /dev/null +++ b/bugzilla-3.2.10-CVE-2011-2381.patch @@ -0,0 +1,27 @@ +=== modified file 'Bugzilla/Template.pm' +--- Bugzilla/Template.pm 2011-02-14 21:56:52 +0000 ++++ Bugzilla/Template.pm 2011-07-06 14:44:21 +0000 +@@ -549,6 +549,9 @@ + # as prefix. In addition it replaces a ' ' by a '_'. + css_class_quote => \&Bugzilla::Util::css_class_quote , + ++ # Removes control characters and trims extra whitespace. ++ clean_text => \&Bugzilla::Util::clean_text , ++ + quoteUrls => [ sub { + my ($context, $bug) = @_; + return sub { + +=== modified file 'template/en/default/request/email.txt.tmpl' +--- template/en/default/request/email.txt.tmpl 2009-09-03 19:05:33 +0000 ++++ template/en/default/request/email.txt.tmpl 2011-07-06 14:43:11 +0000 +@@ -50,7 +50,7 @@ + To: [% to %] + Subject: [% flag.type.name %] [%+ subject_status %]: [[% terms.Bug %] [%+ bug.bug_id %]] [% bug.short_desc %] + [%- IF attachment %] : +- [Attachment [% attachment.id %]] [% attachment.description %][% END %] ++ [Attachment [% attachment.id %]] [% attachment.description FILTER clean_text %][% END %] + X-Bugzilla-Type: request + [%+ threadingmarker %] + + diff --git a/bugzilla-3.2.10-CVE-2011-2976.patch b/bugzilla-3.2.10-CVE-2011-2976.patch new file mode 100644 index 0000000..c8d8e93 --- /dev/null +++ b/bugzilla-3.2.10-CVE-2011-2976.patch @@ -0,0 +1,96 @@ +=== modified file 'template/en/default/bug/navigate.html.tmpl' +--- template/en/default/bug/navigate.html.tmpl 2008-01-28 01:21:11 +0000 ++++ template/en/default/bug/navigate.html.tmpl 2011-05-26 19:06:35 +0000 +@@ -44,22 +44,24 @@ + [% END %] + + [% IF this_bug_idx != -1 %] +- First +- Last ++ First ++ Last + [% END %] + + [% IF bug.bug_id %] + [% IF this_bug_idx != -1 %] + [% IF this_bug_idx > 0 %] + [% prev_bug = this_bug_idx - 1 %] +- Prev ++ Prev + [% ELSE %] + Prev + [% END %] + + [% IF this_bug_idx + 1 < bug_list.size %] + [% next_bug = this_bug_idx + 1 %] +- Next ++ Next + [% ELSE %] + Next + [% END %] + +=== modified file 'template/en/default/filterexceptions.pl' +--- template/en/default/filterexceptions.pl 2009-10-26 11:31:52 +0000 ++++ template/en/default/filterexceptions.pl 2011-05-26 19:15:14 +0000 +@@ -250,10 +250,6 @@ + ], + + 'global/site-navigation.html.tmpl' => [ +- 'bug_list.first', +- 'bug_list.$prev_bug', +- 'bug_list.$next_bug', +- 'bug_list.last', + 'bug.bug_id', + 'bug.votes', + ], +@@ -300,13 +296,6 @@ + '" spellcheck=\"$spellcheck\"" IF spellcheck', + ], + +-'bug/navigate.html.tmpl' => [ +- 'bug_list.first', +- 'bug_list.last', +- 'bug_list.$prev_bug', +- 'bug_list.$next_bug', +-], +- + 'bug/show-multiple.html.tmpl' => [ + 'attachment.id', + 'flag.status', + +=== modified file 'template/en/default/global/site-navigation.html.tmpl' +--- template/en/default/global/site-navigation.html.tmpl 2008-08-08 06:26:33 +0000 ++++ template/en/default/global/site-navigation.html.tmpl 2011-05-26 19:16:12 +0000 +@@ -36,8 +36,10 @@ + [% IF bug_list && bug_list.size > 0 %] + + +- +- ++ ++ + + [% IF bug && bug.bug_id %] + [% current_bug_idx = lsearch(bug_list, bug.bug_id) %] +@@ -45,12 +47,14 @@ + + [% IF current_bug_idx > 0 %] + [% prev_bug = current_bug_idx - 1 %] +- ++ + [% END %] + + [% IF current_bug_idx + 1 < bug_list.size %] + [% next_bug = current_bug_idx + 1 %] +- ++ + [% END %] + + [% END %] + diff --git a/bugzilla-3.2.10-CVE-2011-2978.patch b/bugzilla-3.2.10-CVE-2011-2978.patch new file mode 100644 index 0000000..36508b9 --- /dev/null +++ b/bugzilla-3.2.10-CVE-2011-2978.patch @@ -0,0 +1,13 @@ +=== modified file 'userprefs.cgi' +--- userprefs.cgi 2009-02-02 19:21:09 +0000 ++++ userprefs.cgi 2011-07-22 08:00:33 +0000 +@@ -120,7 +120,7 @@ + && Bugzilla->params->{"allowemailchange"} + && $cgi->param('new_login_name')) + { +- my $old_login_name = $cgi->param('Bugzilla_login'); ++ my $old_login_name = $user->login; + my $new_login_name = trim($cgi->param('new_login_name')); + + if($old_login_name ne $new_login_name) { + diff --git a/bugzilla-3.2.10-CVE-2011-3657.patch b/bugzilla-3.2.10-CVE-2011-3657.patch new file mode 100644 index 0000000..30ad9d0 --- /dev/null +++ b/bugzilla-3.2.10-CVE-2011-3657.patch @@ -0,0 +1,29 @@ +=== modified file 'Bugzilla/Chart.pm' +--- Bugzilla/Chart.pm 2010-07-06 00:42:57 +0000 ++++ Bugzilla/Chart.pm 2011-10-27 13:19:40 +0000 +@@ -438,7 +438,7 @@ + + require Data::Dumper; + print "
Bugzilla::Chart object:\n"; +- print Data::Dumper::Dumper($self); ++ print html_quote(Data::Dumper::Dumper($self)); + print ""; + } + + +=== modified file 'report.cgi' +--- report.cgi 2010-12-08 20:14:32 +0000 ++++ report.cgi 2011-10-27 14:18:52 +0000 +@@ -293,9 +293,9 @@ + if ($cgi->param('debug')) { + require Data::Dumper; + print "
data hash:\n"; +- print Data::Dumper::Dumper(%data) . "\n\n"; ++ print html_quote(Data::Dumper::Dumper(%data)) . "\n\n"; + print "data array:\n"; +- print Data::Dumper::Dumper(@image_data) . "\n\n"; ++ print html_quote(Data::Dumper::Dumper(@image_data)) . "\n\n"; + } + + # All formats point to the same section of the documentation. + diff --git a/bugzilla-3.2.10-CVE-2011-3667.patch b/bugzilla-3.2.10-CVE-2011-3667.patch new file mode 100644 index 0000000..2647120 --- /dev/null +++ b/bugzilla-3.2.10-CVE-2011-3667.patch @@ -0,0 +1,197 @@ +=== modified file 'Bugzilla/User.pm' +--- Bugzilla/User.pm 2011-12-08 23:20:02 +0000 ++++ Bugzilla/User.pm 2011-12-27 14:59:07 +0000 +@@ -1852,6 +1852,32 @@ + return 1; + } + ++sub check_account_creation_enabled { ++ my $self = shift; ++ ++ # If we're using e.g. LDAP for login, then we can't create a new account. ++ $self->authorizer->user_can_create_account ++ || ThrowUserError('auth_cant_create_account'); ++ ++ Bugzilla->params->{'createemailregexp'} ++ || ThrowUserError('account_creation_disabled'); ++} ++ ++sub check_and_send_account_creation_confirmation { ++ my ($self, $login) = @_; ++ ++ $login = $self->check_login_name_for_creation($login); ++ my $creation_regexp = Bugzilla->params->{'createemailregexp'}; ++ ++ if ($login !~ /$creation_regexp/i) { ++ ThrowUserError('account_creation_restricted'); ++ } ++ ++ # Create and send a token for this new account. ++ require Bugzilla::Token; ++ Bugzilla::Token::issue_new_user_account_token($login); ++} ++ + sub login_to_id { + my ($login, $throw_error) = @_; + my $dbh = Bugzilla->dbh; +@@ -2355,6 +2381,17 @@ + Takes a username as its only argument. Throws an error if there is no + user with that username. Returns a C