From 5486a14b909fff25dcddbb2402039e23bee3ca36 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 28 May 2020 17:43:19 +1000 Subject: [PATCH] Update to use code from Drupal's patch --- js/Common.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/js/Common.js b/js/Common.js index 1c349b323f..dc0cc8f10d 100644 --- a/js/Common.js +++ b/js/Common.js @@ -1661,6 +1661,26 @@ if (!CRM.vars) CRM.vars = {}; // CVE-2020-11022 and CVE-2020-11023 Passing HTML from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code. $.htmlPrefilter = function(html) { + // This is how jQuery determines the first tag in the HTML. + // @see https://github.com/jquery/jquery/blob/1.5/jquery.js#L5521 + var tag = ( rtagName.exec( html ) || [ "", "" ] )[ 1 ].toLowerCase(); + + // It is not valid HTML for to have