diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/web/AMWebController.java b/tez-dag/src/main/java/org/apache/tez/dag/app/web/AMWebController.java index e547dad520..b1a028fa07 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/app/web/AMWebController.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/app/web/AMWebController.java @@ -921,17 +921,71 @@ private void render(PrintWriter pw) { "
To enable tracking url pointing to Tez UI, set the config " + TezConfiguration.TEZ_HISTORY_URL_BASE + " in the tez-site.xml.
"); } else { + // historyUrl is derived from a submitter-supplied AM configuration + // property (tez.tez-ui.history-url.base). Escape it before splicing + // into the HTML attribute and the inline JS string literal so a + // value like ' or " cannot break out and run script in the browser + // of whoever opens the AM tracking URL. pw.write("If you are not redirected shortly, click " + - "here
" + "here" ); pw.write(""); + "window.location.replace('" + escapeJsString(historyUrl) + "');" + + "}, 0); "); } pw.write("