Skip to content

Commit f0760dd

Browse files
Simon Greendklawren
authored andcommitted
Bug 1036213 - (CVE-2014-1546) add '/**/' before jsonrpc.cgi callback to avoid swf content type sniff vulnerability
r=glob,a=sgreen
1 parent 26728e3 commit f0760dd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Bugzilla/WebService/Server/JSONRPC.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ sub response {
9191
# Implement JSONP.
9292
if (my $callback = $self->_bz_callback) {
9393
my $content = $response->content;
94-
$response->content("$callback($content)");
95-
94+
# Prepend the JSONP response with /**/ in order to protect
95+
# against possible encoding attacks (e.g., affecting Flash).
96+
$response->content("/**/$callback($content)");
9697
}
9798

9899
# Use $cgi->header properly instead of just printing text directly.

0 commit comments

Comments
 (0)