]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1221518: (CVE-2015-8508) [SECURITY] XSS in dependency graphs when displaying...
authorFrédéric Buclin <LpSolit@gmail.com>
Tue, 22 Dec 2015 17:56:39 +0000 (18:56 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 22 Dec 2015 17:56:39 +0000 (18:56 +0100)
r=gerv a=dkl

showdependencygraph.cgi

index a023dd77dfd79b47505d53f018b1133e129c2e8e..27e063f6224cf943f67ac9e5d835253f1ee67ed0 100755 (executable)
@@ -61,7 +61,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{<area alt="bug $bugid" name="bug$bugid" shape="rect" } .
                     qq{title="$bugtitle" href="$url" } .
                     qq{coords="$leftx,$topy,$rightx,$bottomy">\n};
@@ -180,13 +180,16 @@ foreach my $k (@bug_ids) {
     # Retrieve bug information from the database
     my ($stat, $resolution, $summary) = $dbh->selectrow_array($sth, undef, $k);
 
-    # Resolution and summary are shown only if user can see the bug
-    if (!$user->can_see_bug($k)) {
+    $vars->{'short_desc'} = $summary if ($k eq $cgi->param('id'));
+
+    # The bug summary is shown only if the user can see the bug.
+    if ($user->can_see_bug($k)) {
+        $summary = html_quote(clean_text($summary));
+    }
+    else {
         $summary = '';
     }
 
-    $vars->{'short_desc'} = $summary if ($k eq $cgi->param('id'));
-
     my @params;
 
     if ($summary ne "" && $cgi->param('showsummary')) {