Skip to content

Commit

Permalink
Bug 1253263 - (CVE-2016-2803) [SECURITY] XSS vulnerability in depende…
Browse files Browse the repository at this point in the history
…ncy graphs via bug summary

r/a=dkl
  • Loading branch information
LpSolit committed May 16, 2016
1 parent abfe21f commit dd61903
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion showdependencygraph.cgi
Expand Up @@ -55,13 +55,19 @@ sub CreateImagemap {
$default = qq{<area alt="" shape="default" href="$1">\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{<area alt="bug $bugid" name="bug$bugid" shape="rect" } .
qq{title="$bugtitle" href="$url" } .
qq{coords="$leftx,$topy,$rightx,$bottomy">\n};
Expand Down

0 comments on commit dd61903

Please sign in to comment.