TEZ-4755: AMWebController: rendering improvements in StaticAMView - #538
Open
abstractdog wants to merge 1 commit into
Open
abstractdog wants to merge 1 commit into
abstractdog wants to merge 1 commit into
Conversation
Encode the configured history-url value when splicing it into the StaticAMView redirect page so unexpected characters cannot alter the surrounding HTML or JavaScript context. Adds a unit test. Co-Authored-By: Claude Code <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
U+2028 and U+2029 can still break the inline JavaScript redirect.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates StaticAMView to safely encode configured history URLs in HTML and JavaScript contexts.
Changes:
- Adds context-specific escaping helpers.
- Applies escaping to rendered redirects.
- Adds regression tests for injection characters.
File summaries
| File | Summary |
|---|---|
tez-dag/src/test/java/org/apache/tez/dag/app/web/TestAMWebController.java |
Adds escaping regression coverage. |
tez-dag/src/main/java/org/apache/tez/dag/app/web/AMWebController.java |
Escapes history URLs before rendering; JavaScript line terminators remain unhandled. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+974
to
+979
| default: | ||
| if (c < 0x20) { | ||
| sb.append(String.format("\\u%04x", (int) c)); | ||
| } else { | ||
| sb.append(c); | ||
| } |
|
🎊 +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.
Encode the configured history-url value when splicing it into the StaticAMView redirect page so unexpected characters cannot alter the surrounding HTML or JavaScript context. Adds a unit test.