Close two paths that reach services past their intended gate - #3512
Open
chenBright wants to merge 1 commit into
Open
Close two paths that reach services past their intended gate#3512chenBright wants to merge 1 commit into
chenBright wants to merge 1 commit into
Conversation
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.
What problem does this PR solve?
Issue Number: resolve
Problem Summary:
Paths that differ only in empty segments dispatched identically.
FindMethodPropertyByURIImplsplitsthe path with a
StringSplitterthat skips empty fields, so//flags,/flags//and/flags//portall resolvedto the same method as
/flags. RFC 3986 treats//fooand/fooas distinct paths, so a front proxy whoseACL matches the collapsed form does not match the padded one and passes it through —
//flags?setvalue=reaches a builtin service that
/flagscannot. Normalizing the path server-side would not help, because theproxy has already forwarded the padded literal; only rejecting it removes the differential.
The same audit found that HTTP/2 never validated
:path. RFC 9113 8.3.1 requires it to be non-empty and,apart from the asterisk-form used by
OPTIONS, to begin with/.What is changed and the side effects?
Changed:
FindMethodPropertyByURIrejects any path containing//. The check lives inthe funnel rather than in
FindMethodPropertyByURIImpl, so it also covers theglobal restful map, which does its own
NormalizeSlashes.H2StreamContext::ConsumeHeadersrejects a:paththat is empty or does notbegin with
/, unless it is exactly*.Side effects:
Performance effects:
Breaking backward compatibility:
Check List: