Skip to content

Commit 16176cb

Browse files
committed
Bug 1234237 - Backport upstream bug 1232785 to bmo/4.2 [SECURITY] Buglists in CSV format can be parsed as valid javascript in some browsers
1 parent 8f50123 commit 16176cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Bugzilla/Template.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,9 @@ sub create {
860860
{
861861
my ($var) = @_;
862862
$var = ' ' . $var if substr($var, 0, 1) eq '=';
863+
# backslash is not special to CSV, but it can be used to confuse some browsers...
864+
# so we do not allow it to happen. We only do this for logged-in users.
865+
$var =~ s/\\/\x{FF3C}/g if Bugzilla->user->id;
863866
$var =~ s/\"/\"\"/g;
864867
if ($var !~ /^-?(\d+\.)?\d*$/) {
865868
$var = "\"$var\"";

0 commit comments

Comments
 (0)