Repository navigation
fix: escape request paths in generated html pages - #17
Merged
Merged
Conversation
…ndex The Maven directory listing put the request path into the title, heading and base href, and file names into the link text and href, without escaping. Paths are now percent-encoded per segment and HTML-escaped through the shared helper. (cherry picked from commit f387e6c) The shared HtmlEscaping helper (from 6aeadde) is included here because the directory index depends on it.
The request path was interpolated into the dashboard href and the visible link text without escaping, so a crafted URL could inject markup. The path is now decoded once, percent-encoded per segment and HTML-escaped. The base path is escaped the same way. The # route shape is unchanged.
Test results 72 files 72 suites 8m 16s ⏱️ Results for commit 8d69282. ♻️ This comment has been updated with latest results. |
5 of 7 tasks
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
Two reflected HTML injection points in 1.1.0:
href, and file names into link text andhref, without escaping.hrefand visible text without escaping, so a crafted URL could inject markup.Both now percent-encode the path per segment and HTML-escape the result through the shared
HtmlEscapinghelper. The not-found page decodes the path once before encoding it, and the base path is escaped the same way. The#route shape is unchanged. The directory index depends on the helper, which is included here.Intended for the 1.1.1 patch release.
Type of change
fix- bug fixfeat- new featurerefactor- internal change without behaviour changeperf- performance improvementdocs- documentation onlytest- tests onlybuild/ci/chore- tooling, dependencies, pipelinesHow was this tested?
Targeted runs locally:
DirectoryIndexPageTest: markup in request paths and file names is rendered as literal text, and links still resolve to the escaped, percent-encoded paths.NotFoundTemplateTest: a crafted request path cannot inject markup into the dashboard link, and the link keeps the#route shape.The full suite runs in CI.
Checklist
CLAUDE.md(English, imperative, one offeat,fix,docs,refactor,test,build,ci,chore,perf)./gradlew buildpasses locally