You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2019/05/27 11:09:48 UTC

[GitHub] [drill] agozhiy commented on a change in pull request #1795: DRILL-7276: Fixed an XSS vulnerability in Drill Web-UI query profile …

agozhiy commented on a change in pull request #1795: DRILL-7276: Fixed an XSS vulnerability in Drill Web-UI query profile …
URL: https://github.com/apache/drill/pull/1795#discussion_r287747838
 
 

 ##########
 File path: exec/java-exec/src/main/resources/rest/alertModals.ftl
 ##########
 @@ -62,14 +62,18 @@
         var inputValuesKeys = Object.keys(inputValues);
         for (i=0; i<inputValuesKeys.length; ++i) {
             let currKey=inputValuesKeys[i];
-            updatedHtml=updatedHtml.replace(currKey, inputValues[currKey]);
+            updatedHtml=updatedHtml.replace(currKey, escapeHtml(inputValues[currKey]));
         }
         modalBody.innerHTML=updatedHtml;
       }
       //Show Alert
       $('#errorModal').modal('show');
     }
 
+    function escapeHtml(str) {
+        return str.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;') ;
 
 Review comment:
   Done.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services