YARN: escape the AM-supplied tracking url in the apps table blocks#8617
Open
nishat-06 wants to merge 1 commit into
Open
YARN: escape the AM-supplied tracking url in the apps table blocks#8617nishat-06 wants to merge 1 commit into
nishat-06 wants to merge 1 commit into
Conversation
The tracking url is concatenated raw into href='...' inside the appsTableData script block while every neighbouring app-supplied column is escaped.
|
💔 -1 overall
This message was automatically generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
The apps tables in the RM, ApplicationHistory, FairScheduler and Router web UIs build their rows into a
StringBuilderand emit the result inside a<script>element asvar appsTableData=.... Every application-supplied column in that array (user, name, type, tags, queue) already goes throughescapeEcmaScript(escapeHtml4(...)), but the tracking URL is concatenated straight intohref='...', andApplicationReport.getTrackingUrl()hands backRMAppAttemptImpl.originalTrackingUrlverbatim for an unmanaged AM, so the string a client passes toregisterApplicationMasterreaches the page unfiltered. A tracking URL holding a quote or a</script>closes the attribute or the script element and runs in the browser of anyone listing applications, so the escaping the neighbouring columns already use is applied here too. The Router copy has anescape()helper of its own that this one call site was skipping.How was this patch tested?
New
TestAppsBlock#testTrackingUrlIsEscapedrendersAppsBlockwith a report whose tracking URL carries a</script><script>payload; it fails on trunk and passes with the change.TestAppsBlock,TestRMWebApp,TestRMWebAppFairScheduler,TestAppPageandTestFederationWebAppall pass, and checkstyle reports nothing new on the touched files.For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?AI Tooling
If an AI tool was used:
where is the name of the AI tool used.
https://www.apache.org/legal/generative-tooling.html