]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1036213 - (CVE-2014-1546) add '/**/' before jsonrpc.cgi callback to avoid swf...
authorSimon Green <sgreen@redhat.com>
Thu, 24 Jul 2014 17:09:33 +0000 (17:09 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Thu, 24 Jul 2014 17:09:33 +0000 (17:09 +0000)
r=glob,a=sgreen

Bugzilla/WebService/Server/JSONRPC.pm

index 5ee341b4b11b38ffb951ed60721af6cc6afd4df6..90334fc7f3c88af7edaa253c49f2ace19fb129ec 100644 (file)
@@ -91,8 +91,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.