Repository navigation
Move runnable examples to turismo-bootstrap - #49
Merged
Merged
Conversation
Fixes code scanning alert java/xss (#4), whose flows all started in the example routes echoing request parameters into the response. The examples now live, with output escaping, in the separate turismo-bootstrap starter project, and the README links to it. ServletTest loaded example.AppRoutes by name, so it gets its own TestRoutes class. Jetty was only used by the examples, so its test dependencies are dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K3srgwegxijKeNJuJyGifT
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.
Fixes code scanning alert
java/xss(#4, reported atStringPrinter.java:40).Why
All four of the alert's flows started in the demo routes under
src/test/.../example/, which echoed request data straight into the response: theqparameter in three/searchroutes, and path params inExampleAppRoutesList.print()itself is a raw writer by design (the framework can't know the response content type), so the fix belongs in the example code.Rather than harden demos that ship to nobody, they now live in the separate starter project ghosthack/turismo-bootstrap, with output escaping, an HTTP test, and docs on escaping.
Changes
src/test/java/.../example/andsrc/test/webapp/(web.xmland the JSP).ServletTestloadedexample.AppRoutesby class name; it now uses its ownservlet/TestRoutes.jetty-ee10-servlet/jetty-ee10-webapptest dependencies and thejetty.versionproperty. Only the examples used them.Verification
mvn -B verify: 123 tests, 0 failures.java/xssquery run locally: 0 results (1 result with 4 flows before).🤖 Generated with Claude Code
https://claude.ai/code/session_01K3srgwegxijKeNJuJyGifT
Generated by Claude Code