Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path: Fix merge slash for paths ending with slash and present query args #10922

Merged
merged 3 commits into from
Apr 24, 2020

Conversation

euroelessar
Copy link
Contributor

Commit Message: Order of path suffix and query string was wrong, so the ending slash was moved to a query. Tests did not cover this scenario so add a new one.
Additional Description: n/a
Risk Level: low (bug fix)
Testing: added unit test
Docs Changes: n/a
Release Notes: added
Fixes #10912

Ruslan Nigmatullin added 3 commits April 23, 2020 15:39
…tring

Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
@euroelessar
Copy link
Contributor Author

@jmarantz Can you have a look, please?

const absl::string_view path_suffix = absl::EndsWith(path, "/") ? "/" : absl::string_view();
headers.setPath(absl::StrCat(path_prefix,
absl::StrJoin(absl::StrSplit(path, '/', absl::SkipEmpty()), "/"),
path_suffix, query));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH this transform scares me from a security perspective, but I guess it's off by default so someone has to consciously enable it.

@htuch for visibility and @envoyproxy/senior-maintainers pass

At a glance it looks fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it seems this could be a source of potential vulnerability if enabled. @euroelessar do you think this is worth a security advisory? This is all tempered by this not being RFC mandated behavior.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me longer than I would like to admit to grok this given the variable name changes, but once I did that this looks like a straightforward fix, thanks.

@mattklein123 mattklein123 merged commit 09d3d00 into envoyproxy:master Apr 24, 2020
spenceral added a commit to spenceral/envoy that referenced this pull request Apr 27, 2020
Signed-off-by: Spencer Lewis <slewis@squareup.com>

* master:
  fault injection: add support for setting gRPC status (envoyproxy#10841)
  tests: tag tests that fail on Windows with fails_on_windows (envoyproxy#10940)
  Fix typo on Postgres Proxy documentation. (envoyproxy#10930)
  fuzz: improve header/data stop/continue modeling in HCM fuzzer. (envoyproxy#10931)
  gzip filter: allow setting zlib compressor's chunk size (envoyproxy#10508)
  http: replace vector/reserve with InlinedVector in codec helper (envoyproxy#10941)
  stats: add utilities to create stats from a vector of tokens, mixing dynamic and symbolic elements. (envoyproxy#10735)
  hcm: avoid invoking 100-continue handling on decode filter. (envoyproxy#10929)
  prometheus stats: Correctly group lines of the same metric name. (envoyproxy#10833)
  status: Fix ASAN error in Status payload handling (envoyproxy#10906)
  path: Fix merge slash for paths ending with slash and present query args (envoyproxy#10922)
  compressor filter: add benchmark (envoyproxy#10464)
  xray: expected_span_name is not captured by the lambda with MSVC (envoyproxy#10934)
  ci: update before purge in cleanup (envoyproxy#10938)
  tracer: Improve test coverage for x-ray (envoyproxy#10890)
  Revert "init: order dynamic resource initialization to make RTDS always be first (envoyproxy#10362)" (envoyproxy#10919)
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.

merge_slashes option moves trailing slash from path to end of the the query string
4 participants