From a11853423e25a7aca01237343fdf61ab1d819a9f Mon Sep 17 00:00:00 2001 From: Dylan Hardison Date: Tue, 22 Dec 2015 13:34:38 -0500 Subject: Bug 1232785 - [SECURITY] Buglists in CSV format can be parsed as valid javascript in some browsers r=dkl,a=dkl --- Bugzilla/Template.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Bugzilla') diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 80f091f8c..ce027171b 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -871,6 +871,9 @@ sub create { { my ($var) = @_; $var = ' ' . $var if substr($var, 0, 1) eq '='; + # backslash is not special to CSV, but it can be used to confuse some browsers... + # so we do not allow it to happen. We only do this for logged-in users. + $var =~ s/\\/\x{FF3C}/g if Bugzilla->user->id; $var =~ s/\"/\"\"/g; if ($var !~ /^-?(\d+\.)?\d*$/) { $var = "\"$var\""; -- cgit v1.2.1