Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
5af7bc0b
Unverified
Commit
5af7bc0b
authored
Aug 29, 2024
by
Dave Miller
Committed by
GitHub
Aug 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1439260: XSS in chart.cgi and report.cgi
parent
85c3770f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
30 deletions
+0
-30
chart.cgi
chart.cgi
+0
-8
report.cgi
report.cgi
+0
-22
No files found.
chart.cgi
View file @
5af7bc0b
...
...
@@ -318,15 +318,11 @@ sub plot {
my
$format
=
$template
->
get_format
(
"reports/chart"
,
""
,
scalar
(
$cgi
->
param
(
'ctype'
)));
$format
->
{
'ctype'
}
=
'text/html'
if
$cgi
->
param
(
'debug'
);
$cgi
->
set_dated_content_disp
(
'inline'
,
'chart'
,
$format
->
{
extension
});
print
$cgi
->
header
(
$format
->
{
'ctype'
});
disable_utf8
()
if
(
$format
->
{
'ctype'
}
=~
/^image\//
);
# Debugging PNGs is a pain; we need to be able to see the error messages
$vars
->
{
'chart'
}
->
dump
()
if
$cgi
->
param
(
'debug'
);
$template
->
process
(
$format
->
{
'template'
},
$vars
)
||
ThrowTemplateError
(
$template
->
error
());
}
...
...
@@ -362,10 +358,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
());
}
report.cgi
View file @
5af7bc0b
...
...
@@ -312,13 +312,6 @@ $vars->{'height'} = $height;
$vars
->
{
'queries'
}
=
$extra_data
;
$vars
->
{
'saved_report_id'
}
=
$cgi
->
param
(
'saved_report_id'
);
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
...
...
@@ -367,24 +360,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
;
say
"<pre>data hash:"
;
say
html_quote
(
Data::Dumper::
Dumper
(
%
data
));
say
"\ndata array:"
;
say
html_quote
(
Data::Dumper::
Dumper
(
@image_data
))
.
"\n\n</pre>"
;
}
# All formats point to the same section of the documentation.
$vars
->
{
'doc_section'
}
=
'using/reports-and-charts.html#reports'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment