Skip to content

Close two paths that reach services past their intended gate - #3512

Open
chenBright wants to merge 1 commit into
apache:masterfrom
chenBright:fix_intended_path
Open

Close two paths that reach services past their intended gate#3512
chenBright wants to merge 1 commit into
apache:masterfrom
chenBright:fix_intended_path

Conversation

@chenBright

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: resolve

Problem Summary:

Paths that differ only in empty segments dispatched identically. FindMethodPropertyByURIImpl splits
the path with a StringSplitter that skips empty fields, so //flags, /flags// and /flags//port all resolved
to the same method as /flags. RFC 3986 treats //foo and /foo as distinct paths, so a front proxy whose
ACL matches the collapsed form does not match the padded one and passes it through — //flags?setvalue=
reaches a builtin service that /flags cannot. Normalizing the path server-side would not help, because the
proxy 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:

  • FindMethodPropertyByURI rejects any path containing //. The check lives in
    the funnel rather than in FindMethodPropertyByURIImpl, so it also covers the
    global restful map, which does its own NormalizeSlashes.
  • H2StreamContext::ConsumeHeaders rejects a :path that is empty or does not
    begin with /, unless it is exactly *.

Side effects:

  • Performance effects:

  • Breaking backward compatibility:


Check List:

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.

1 participant