Skip to content

Limit proxy protocol header to 256 bytes - #3199

Closed
gbrodman wants to merge 1 commit into
google:masterfrom
gbrodman:maxHeaderBytes
Closed

Limit proxy protocol header to 256 bytes#3199
gbrodman wants to merge 1 commit into
google:masterfrom
gbrodman:maxHeaderBytes

Conversation

@gbrodman

@gbrodman gbrodman commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

The maximum length for the proxy header according to https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt is actually 108 bytes but we use 256 just to be safe.

We don't want to allow a potential attacker to send a continuous slow stream of characters, possibly causing an OOM.

All of our traffic should come through the load balancer so this shouldn't be an issue; this is just defense-in-depth

D.4 12

b/535251420


This change is Reviewable

The maximum length for the proxy header according to
https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt is actually
108 bytes but we use 256 just to be safe.

We don't want to allow a potential attacker to send a continuous slow
stream of characters, possibly causing an OOM.

All of our traffic should come through the load balancer so this
shouldn't be an issue; this is just defense-in-depth

D.4 12

b/535251420
@gbrodman
gbrodman requested a review from ptkach August 5, 2026 12:45
@gbrodman

gbrodman commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

actually nvm we're gonna delete this since we can get the source IP from the context, even with requests coming through the proxy

@gbrodman gbrodman closed this Aug 5, 2026
@gbrodman
gbrodman deleted the maxHeaderBytes branch August 5, 2026 18:53
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