From 49b2e90cdea1a01d532f53f411ad82b012f490fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Tue, 22 Dec 2015 19:00:48 +0100 Subject: [PATCH] Bug 1221518: (CVE-2015-8508) [SECURITY] XSS in dependency graphs when displaying the bug summary r/a=dkl --- showdependencygraph.cgi | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi index a461187fa5..9e060c6da9 100755 --- a/showdependencygraph.cgi +++ b/showdependencygraph.cgi @@ -73,7 +73,7 @@ sub CreateImagemap { # Pick up bugid from the mapdata label field. Getting the title from # bugtitle hash instead of mapdata allows us to get the summary even # when showsummary is off, and also gives us status and resolution. - my $bugtitle = html_quote(clean_text($bugtitles{$bugid})); + my $bugtitle = $bugtitles{$bugid}; $map .= qq{bug $bugid\n}; @@ -188,13 +188,16 @@ foreach my $k (keys(%seen)) { # Retrieve bug information from the database my ($stat, $resolution, $summary) = $dbh->selectrow_array($sth, undef, $k); + $vars->{'short_desc'} = $summary if ($k eq $cgi->param('id')); + # Resolution and summary are shown only if user can see the bug - if (!Bugzilla->user->can_see_bug($k)) { + if (Bugzilla->user->can_see_bug($k)) { + $summary = html_quote(clean_text($summary)); + } + else { $resolution = $summary = ''; } - $vars->{'short_desc'} = $summary if ($k eq $cgi->param('id')); - my @params; if ($summary ne "" && $cgi->param('showsummary')) { -- 2.47.2