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
d3d080ff
Commit
d3d080ff
authored
Apr 17, 2014
by
Manish Goregaokar
Committed by
Frédéric Buclin
Apr 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 968576: [SECURITY] Dangerous control characters allowed in Bugzilla text
r=glob a=justdave
parent
2f385c10
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-2
Template.pm
Bugzilla/Template.pm
+11
-0
Util.pm
Bugzilla/Util.pm
+4
-0
bugmail.txt.tmpl
template/en/default/email/bugmail.txt.tmpl
+1
-1
flagmail.txt.tmpl
template/en/default/email/flagmail.txt.tmpl
+1
-1
No files found.
Bugzilla/Template.pm
View file @
d3d080ff
...
...
@@ -645,6 +645,17 @@ sub create {
my
(
$data
)
=
@_
;
return
encode_base64
(
$data
);
},
# Strips out control characters excepting whitespace
strip_control_chars
=>
sub
{
my
(
$data
)
=
@_
;
# Only run for utf8 to avoid issues with other multibyte encodings
# that may be reassigning meaning to ascii characters.
if
(
Bugzilla
->
params
->
{
'utf8'
})
{
$data
=~
s/(?![\t\r\n])[[:cntrl:]]//g
;
}
return
$data
;
},
# HTML collapses newlines in element attributes to a single space,
# so form elements which may have whitespace (ie comments) need
...
...
Bugzilla/Util.pm
View file @
d3d080ff
...
...
@@ -68,6 +68,10 @@ sub html_quote {
# Obscure '@'.
$var
=~
s/\@/\@/g
;
if
(
Bugzilla
->
params
->
{
'utf8'
})
{
# Remove control characters if the encoding is utf8.
# Other multibyte encodings may be using this range; so ignore if not utf8.
$var
=~
s/(?![\t\r\n])[[:cntrl:]]//g
;
# Remove the following characters because they're
# influencing BiDi:
# --------------------------------------------------------
...
...
template/en/default/email/bugmail.txt.tmpl
View file @
d3d080ff
...
...
@@ -19,7 +19,7 @@
[%- IF comment.count %]
--- Comment #[% comment.count %] from [% comment.author.identity %] ---
[% END %]
[%+ comment.body_full({ is_bugmail => 1, wrap => 1 }) %]
[%+ comment.body_full({ is_bugmail => 1, wrap => 1 })
FILTER strip_control_chars
%]
[% END %]
-- [%# Protect the trailing space of the signature marker %]
...
...
template/en/default/email/flagmail.txt.tmpl
View file @
d3d080ff
...
...
@@ -68,7 +68,7 @@ Attachment [% attidsummary %]
[%-# .defined is necessary to avoid a taint issue in Perl < 5.10.1, see bug 509794. %]
[% IF Bugzilla.cgi.param("comment").defined && Bugzilla.cgi.param("comment").length > 0 %]
------- Additional Comments from [% user.identity %]
[%+ Bugzilla.cgi.param("comment") %]
[%+ Bugzilla.cgi.param("comment")
FILTER strip_control_chars
%]
[% END %]
[%- END %]
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