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,'&').replace(/</g,'<').replace(/>/g,'>') ;
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:
[email protected]
With regards,
Apache Git Services