]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1439260: XSS in chart.cgi and report.cgi
authorDave Miller <github@justdave.net>
Tue, 29 Aug 2023 04:47:11 +0000 (00:47 -0400)
committerDave Miller <justdave@bugzilla.org>
Thu, 29 Aug 2024 10:55:30 +0000 (06:55 -0400)
chart.cgi
report.cgi

index 0e1411f055203d0b038db54728b3c4ac387194f1..88a32782213bc6b6a07cd3ebc2134f41da8b3361 100755 (executable)
--- a/chart.cgi
+++ b/chart.cgi
@@ -318,12 +318,6 @@ sub plot {
   my $format
     = $template->get_format("reports/chart", "", scalar($cgi->param('ctype')));
 
-  # Debugging PNGs is a pain; we need to be able to see the error messages
-  if ($cgi->param('debug')) {
-    print $cgi->header();
-    $vars->{'chart'}->dump();
-  }
-
   print $cgi->header($format->{'ctype'});
   disable_utf8() if ($format->{'ctype'} =~ /^image\//);
 
@@ -362,10 +356,6 @@ sub view {
 
   print $cgi->header();
 
-  # If we have having problems with bad data, we can set debug=1 to dump
-  # the data structure.
-  $chart->dump() if $cgi->param('debug');
-
   $template->process("reports/create-chart.html.tmpl", $vars)
     || ThrowTemplateError($template->error());
 }
index 2f6f906463f7a7bd486c151945b5d7be0399d5b0..a49d931f13f1d7b86e0858e8517c1c2319ade0d7 100755 (executable)
@@ -216,13 +216,6 @@ $vars->{'width'}  = $width  if $width;
 $vars->{'height'} = $height if $height;
 $vars->{'queries'} = $extra_data;
 
-if ( $cgi->param('debug')
-  && Bugzilla->params->{debug_group}
-  && Bugzilla->user->in_group(Bugzilla->params->{debug_group}))
-{
-  $vars->{'debug'} = 1;
-}
-
 if ($action eq "wrap") {
 
   # So which template are we using? If action is "wrap", we will be using
@@ -271,24 +264,9 @@ else {
 my $format = $template->get_format("reports/report", $formatparam,
   scalar($cgi->param('ctype')));
 
-# If we get a template or CGI error, it comes out as HTML, which isn't valid
-# PNG data, and the browser just displays a "corrupt PNG" message. So, you can
-# set debug=1 to always get an HTML content-type, and view the error.
-$format->{'ctype'} = "text/html" if $cgi->param('debug');
-
 $cgi->set_dated_content_disp("inline", "report", $format->{extension});
 print $cgi->header($format->{'ctype'});
 
-# Problems with this CGI are often due to malformed data. Setting debug=1
-# prints out both data structures.
-if ($cgi->param('debug')) {
-  require Data::Dumper;
-  print "<pre>data hash:\n";
-  print html_quote(Data::Dumper::Dumper(%data)) . "\n\n";
-  print "data array:\n";
-  print html_quote(Data::Dumper::Dumper(@image_data)) . "\n\n</pre>";
-}
-
 # All formats point to the same section of the documentation.
 $vars->{'doc_section'} = 'reporting.html#reports';