Repository navigation
Conversation
…ests The router honoured x-envoy-upstream-stream-duration-ms from any client, because cleanInternalHeaders() did not remove it from external requests like the other router timeout and retry control headers. Remove it there, guarded by envoy.reloadable_features.sanitize_upstream_stream_duration_header. Also list the header in the header sanitizing docs, document that it is only honoured for internal clients, and correct the documented response code. Fixes envoyproxy#48066 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lee Boynton <[email protected]>
x-envoy-upstream-stream-duration-ms is now removed from external requests, so set x-forwarded-for to an internal address as the other timeout header integration tests do. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lee Boynton <[email protected]>
Contributor
Author
|
/retest |
lboynton
marked this pull request as ready for review
October 6, 2026 16:33
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.
Commit Message: http: sanitize x-envoy-upstream-stream-duration-ms from external requests
Additional Description:
The router honours the
x-envoy-upstream-stream-duration-msrequest header from any client.ConnectionManagerUtility::cleanInternalHeaders()removes the other router timeout and retry control headers (x-envoy-upstream-rq-timeout-ms,x-envoy-max-retries,x-envoy-retry-on, ...) from external requests, but this one was missed when it was added in #15433. As a result, any external client can set a per-request upstream stream duration and make Envoy abort the upstream request with a local reply.This PR removes the header from external requests alongside the others. The change is guarded by
envoy.reloadable_features.sanitize_upstream_stream_duration_header(defaulttrue) for deployments that send the header from clients Envoy classifies as external.It also adds the header to the header sanitizing docs, documents that it is only honoured for internal clients, and corrects the documented response code: the local reply is a 504, or a 408 if the downstream request has not been fully received (
Http::Utility::maybeRequestTimeoutCode()), not always a 408.This was reported to envoy-security first; they classified it as a bug rather than a vulnerability and asked for a public issue.
Fixes #48066
Risk Level: low. Removes one more header from external requests, runtime guarded.
Testing: unit.
Docs Changes: added.
Release Notes: added.
Platform Specific Features: n/a.
Runtime guard:
envoy.reloadable_features.sanitize_upstream_stream_duration_header🤖 Generated with Claude Code