Bug 1036213 - (CVE-2014-1546) add '/**/' before jsonrpc.cgi callback to avoid swf content type sniff vulnerability

r=glob,a=sgreen


git-svn-id: svn://10.0.0.236/trunk@265475 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzrmirror%bugzilla.org
2014-07-24 17:45:51 +00:00
parent d485e5c714
commit 9951ab2d2a
3 changed files with 5 additions and 3 deletions

View File

@@ -80,7 +80,9 @@ sub response {
# Implement JSONP.
if (my $callback = $self->_bz_callback) {
my $content = $response->content;
$response->content("$callback($content)");
# Prepend the JSONP response with /**/ in order to protect
# against possible encoding attacks (e.g., affecting Flash).
$response->content("/**/$callback($content)");
}
# Use $cgi->header properly instead of just printing text directly.