security/core#33 - Patch jQuery for CVE-2015-9251
authorColeman Watts <coleman@civicrm.org>
Wed, 23 Jan 2019 02:14:03 +0000 (21:14 -0500)
committerSeamus Lee <seamuslee001@gmail.com>
Fri, 22 Feb 2019 00:09:29 +0000 (11:09 +1100)
See https://github.com/jquery/jquery/issues/2432#issuecomment-403761229
This will no longer be needed after upgrading to jQuery 3.x.

js/Common.js

index de326cda0e367aa6c7e91e8e0b2eb82e5e5f899a..93f7b1032f3574e03a46b012ca8f7a3f91df05af 100644 (file)
@@ -1544,4 +1544,11 @@ if (!CRM.vars) CRM.vars = {};
     return (yiq >= 128) ? 'black' : 'white';
   };
 
+  // CVE-2015-9251 - Prevent auto-execution of scripts when no explicit dataType was provided
+  $.ajaxPrefilter(function(s) {
+    if (s.crossDomain) {
+      s.contents.script = false;
+    }
+  });
+
 })(jQuery, _);