Skip to content

reject dot-segment path parameters in RestInvocationHandler - #907

Merged
ok2c merged 1 commit into
apache:masterfrom
Hsnmohd:rest-path-param-dot-segments
Oct 28, 2026
Merged

ok2c merged 1 commit into
apache:masterfrom
Hsnmohd:rest-path-param-dot-segments

Conversation

@Hsnmohd

@Hsnmohd Hsnmohd commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Dot-segment path parameters escape their segment in RestInvocationHandler
URIBuilder.appendPathSegments encodes / and % in a @PathParam value but leaves . and .. as literal dot segments, so @Path("/api/accounts/{id}/profile") called with id = ".." sends GET /api/accounts/../profile, which resolves to /api/profile under RFC 3986 dot-segment removal (the same issue Retrofit fixed as CVE-2018-1000850). Rejected the two values next to the existing null check; percent-encoding the dots would not help since normalization treats %2E as ..

A @PathParam value of "." or ".." was appended as a literal dot segment,
so once the request path is normalized the caller-supplied value moves
the request out of the resource the template maps.
@ok2c
ok2c merged commit f3e886d into apache:master Oct 28, 2026
10 checks passed
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