]> 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:26:23 +0000 (17:26 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Thu, 24 Jul 2014 17:26:23 +0000 (17:26 +0000)
r=glob,a=sgreen

Bugzilla/WebService/Server/JSONRPC.pm

index cec1c29ea2d0cfd020822b282dc476d462bccd09..373aa4fe03851cba82e1cc495568fba7e99b63e5 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.