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

Fix Proxy web server middleware order #51386

Merged
merged 1 commit into from
Jan 23, 2025
Merged

Conversation

rosstimothy
Copy link
Contributor

The limiter middleware was being executed prior to the middleware responsible updating the client IP from X-Forwarded-For headers. This results in erroneously enforcing connection limits in NAT environments.

changelog: Fix an issue that prevented IPs provided in the X-Forwarded-For header from being honored in some scenarios when TrustXForwardedFor is enabled.

The limiter middleware was being executed prior to the middleware
responsible updating the client IP from X-Forwarded-For headers.
This results in erroneously enforcing connection limits in NAT
environments.
@rosstimothy rosstimothy force-pushed the tross/http_middleware_order branch from a944f46 to b762d38 Compare January 23, 2025 00:00
@rosstimothy rosstimothy marked this pull request as ready for review January 23, 2025 00:21
@github-actions github-actions bot requested review from creack and espadolini January 23, 2025 00:21
Copy link
Contributor

@espadolini espadolini left a comment

Choose a reason for hiding this comment

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

Should we apply the limiter before the tracing?

edit: it already is, nevermind

edit 2: is it? 🤔

@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from creack January 23, 2025 00:54
@tigrato
Copy link
Contributor

tigrato commented Jan 23, 2025

Should we apply the limiter before the tracing?

edit: it already is, nevermind

edit 2: is it? 🤔

No it's not. Xff - tracing -limiter is the correct order of execution

@rosstimothy rosstimothy added this pull request to the merge queue Jan 23, 2025
Merged via the queue into master with commit 2617a3d Jan 23, 2025
44 checks passed
@rosstimothy rosstimothy deleted the tross/http_middleware_order branch January 23, 2025 15:57
@public-teleport-github-review-bot

@rosstimothy See the table below for backport results.

Branch Result
branch/v15 Failed
branch/v16 Failed
branch/v17 Create PR

rosstimothy added a commit that referenced this pull request Jan 23, 2025
The limiter middleware was being executed prior to the middleware
responsible updating the client IP from X-Forwarded-For headers.
This results in erroneously enforcing connection limits in NAT
environments.
rosstimothy added a commit that referenced this pull request Jan 23, 2025
The limiter middleware was being executed prior to the middleware
responsible updating the client IP from X-Forwarded-For headers.
This results in erroneously enforcing connection limits in NAT
environments.
github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2025
The limiter middleware was being executed prior to the middleware
responsible updating the client IP from X-Forwarded-For headers.
This results in erroneously enforcing connection limits in NAT
environments.
github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2025
The limiter middleware was being executed prior to the middleware
responsible updating the client IP from X-Forwarded-For headers.
This results in erroneously enforcing connection limits in NAT
environments.
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