Skip to content

normalize module base path before resolving rpc policy resource - #10357

Open
Samin061 wants to merge 2 commits into
gwtproject:mainfrom
Samin061:rpc-module-base-path-normalize
Open

normalize module base path before resolving rpc policy resource#10357
Samin061 wants to merge 2 commits into
gwtproject:mainfrom
Samin061:rpc-module-base-path-normalize

Conversation

@Samin061

@Samin061 Samin061 commented Jul 2, 2026

Copy link
Copy Markdown

ServerSerializationStreamReader validates the strong name before policy lookup, but the module base URL from the same request reaches loadSerializationPolicy untouched, where new URL(moduleBaseURL).getPath() is joined with the strong name and the .gwt.rpc suffix and opened through getResourceAsStream. A value such as http://host/ctx/../../WEB-INF/foo still satisfies the startsWith(contextPath) guard, so the ../ segments survive into the resource path and can point the policy load outside the module directory; getRequestModuleBasePath resolves the symbol-map path the same way. Normalize the path with URI.normalize() before the containment check at both call sites so traversal segments collapse and the existing check rejects anything that leaves the module directory.

Comment thread user/src/com/google/gwt/user/server/rpc/RemoteServiceServlet.java Outdated
Comment thread user/src/com/google/gwt/user/server/rpc/RemoteServiceServlet.java Outdated
@Samin061

Copy link
Copy Markdown
Author

gentle ping

vjay82 pushed a commit to vjay82/gwt that referenced this pull request Jul 21, 2026
Cherry-pick of upstream gwtproject/gwt PR gwtproject#10357. Normalize the client-supplied module base URL with URI.normalize() before the containment check so that ../ traversal segments cannot escape the module directory when locating .gwt.rpc/symbol-map resources.

Upstream-PR: gwtproject#10357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants