Skip to content

Additional safety with X-Forwarded-Host handling#30980

Merged
jentfoo merged 2 commits intomasterfrom
jent/forwarded-host-safety
Aug 25, 2023
Merged

Additional safety with X-Forwarded-Host handling#30980
jentfoo merged 2 commits intomasterfrom
jent/forwarded-host-safety

Conversation

@jentfoo
Copy link
Copy Markdown
Contributor

@jentfoo jentfoo commented Aug 24, 2023

This adds utils.GetSingleHeader as a common way to make sure that additional headers are not being inserted into the request. We use this in the aws, azure, and gcp handler as part of verifying the source of the request.

In addition alpnproxy/local_proxy.go contains a fix where an invalid Host header can allow an arbitrary X-Forwarded-Host value to pass through unchanged.

This PR fixes low severity issue: https://github.com/gravitational/teleport-private/issues/922

Comment thread lib/utils/http.go Outdated
Comment thread lib/utils/http.go Outdated
This adds `utils.GetSingleHeader` as a common way to make sure that additional headers are not being inserted into the request.
We use this in the `aws`, `azure`, and `gcp` handler as part of verifying the source of the request.

In addition `alpnproxy/local_proxy.go` contains a fix where an invalid `Host` header can allow an arbitrary `X-Forwarded-Host` value to pass through unchanged.
@jentfoo jentfoo force-pushed the jent/forwarded-host-safety branch from eae2f5f to 9af9755 Compare August 24, 2023 18:25
Comment thread lib/utils/http.go Outdated
Comment thread lib/utils/http.go
@jentfoo jentfoo added this pull request to the merge queue Aug 24, 2023
@jentfoo jentfoo removed this pull request from the merge queue due to a manual request Aug 24, 2023
@jentfoo jentfoo added this pull request to the merge queue Aug 25, 2023
Merged via the queue into master with commit 5f142d3 Aug 25, 2023
@jentfoo jentfoo deleted the jent/forwarded-host-safety branch August 25, 2023 14:54
@public-teleport-github-review-bot
Copy link
Copy Markdown

@jentfoo See the table below for backport results.

Branch Result
branch/v11 Failed
branch/v12 Failed
branch/v13 Failed

jentfoo added a commit that referenced this pull request Aug 25, 2023
* Additional safety with `X-Forwarded-Host` handling

This adds `utils.GetSingleHeader` as a common way to make sure that additional headers are not being inserted into the request.
We use this in the `aws`, `azure`, and `gcp` handler as part of verifying the source of the request.

In addition `alpnproxy/local_proxy.go` contains a fix where an invalid `Host` header can allow an arbitrary `X-Forwarded-Host` value to pass through unchanged.

* Apply PR feedback around error type and testing
jentfoo added a commit that referenced this pull request Aug 25, 2023
* Additional safety with `X-Forwarded-Host` handling

This adds `utils.GetSingleHeader` as a common way to make sure that additional headers are not being inserted into the request.
We use this in the `aws`, `azure`, and `gcp` handler as part of verifying the source of the request.

In addition `alpnproxy/local_proxy.go` contains a fix where an invalid `Host` header can allow an arbitrary `X-Forwarded-Host` value to pass through unchanged.

* Apply PR feedback around error type and testing
github-merge-queue Bot pushed a commit that referenced this pull request Aug 25, 2023
* Additional safety with `X-Forwarded-Host` handling

This adds `utils.GetSingleHeader` as a common way to make sure that additional headers are not being inserted into the request.
We use this in the `aws`, `azure`, and `gcp` handler as part of verifying the source of the request.

In addition `alpnproxy/local_proxy.go` contains a fix where an invalid `Host` header can allow an arbitrary `X-Forwarded-Host` value to pass through unchanged.

* Apply PR feedback around error type and testing
github-merge-queue Bot pushed a commit that referenced this pull request Aug 25, 2023
* Additional safety with `X-Forwarded-Host` handling

This adds `utils.GetSingleHeader` as a common way to make sure that additional headers are not being inserted into the request.
We use this in the `aws`, `azure`, and `gcp` handler as part of verifying the source of the request.

In addition `alpnproxy/local_proxy.go` contains a fix where an invalid `Host` header can allow an arbitrary `X-Forwarded-Host` value to pass through unchanged.

* Apply PR feedback around error type and testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants