From dd61903154fd363fb4e763d60aa155a507c2c3fc Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Mon, 16 May 2016 20:22:28 +0200 Subject: Bug 1253263 - (CVE-2016-2803) [SECURITY] XSS vulnerability in dependency graphs via bug summary r/a=dkl --- showdependencygraph.cgi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi index 196d8f84e..c45bd06f3 100755 --- a/showdependencygraph.cgi +++ b/showdependencygraph.cgi @@ -55,13 +55,19 @@ sub CreateImagemap { $default = qq{\n}; } - if ($line =~ /^rectangle \((.*),(.*)\) \((.*),(.*)\) (http[^ ]*) (\d+)(\\n.*)?$/) { + if ($line =~ /^rectangle \((\d+),(\d+)\) \((\d+),(\d+)\) (http[^ ]*) (\d+)(?:\\n.*)?$/) { my ($leftx, $rightx, $topy, $bottomy, $url, $bugid) = ($1, $3, $2, $4, $5, $6); # Pick up bugid from the mapdata label field. Getting the title from # bugtitle hash instead of mapdata allows us to get the summary even # when showsummary is off, and also gives us status and resolution. + # This text is safe; it has already been escaped. my $bugtitle = $bugtitles{$bugid}; + + # The URL is supposed to be safe, because it's built manually. + # But in case someone manages to inject code, it's safer to escape it. + $url = html_quote($url); + $map .= qq{bug $bugid\n}; -- cgit v1.2.3-24-g4f1b