IBX-11181: Filtered client-supplied X-Forwarded-* headers in Varnish VCL - #87
Draft
vidarl wants to merge 5 commits into
Draft
IBX-11181: Filtered client-supplied X-Forwarded-* headers in Varnish VCL#87vidarl wants to merge 5 commits into
vidarl wants to merge 5 commits into
Conversation
vidarl
force-pushed
the
IBX-11181-Trusted_Proxies_is_not_set_on_Ibexa_Cloud
branch
from
August 18, 2026 14:19
5267f47 to
434e83e
Compare
|
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.




Caution
DO-NOT-MERGE : PR contains TMP commit with dependencies.json for making CI green
Related PRs:
Description:
Follow-up to ibexa/core#699, which makes Ibexa DXP declare the peer a trusted proxy when a request
arrives via Fastly on Ibexa Cloud. Once trusted proxies are in play, every
X-Forwarded-*header aclient sends is believed by Symfony, so Varnish has to stop them from reaching the application.
Until now the VCLs took
X-Forwarded-Protostraight from the client and derivedX-Forwarded-Portfrom it, and never touched
Forwarded,X-Forwarded-HostorX-Forwarded-Prefix. A client couldtherefore spoof the scheme and host the application sees. Since
X-Forwarded-*is not part of theVarnish cache key, a spoofed value also poisons the cached object for everyone else.
vcl_recvnow strips those headers for every client that is not listed in a newtrusted_proxiesACL in
parameters.vcl, and overwritesX-Forwarded-Forwith the real client IP.X-Client-IPandClient-Cdnare stripped too, so a client cannot fake the Ibexa Cloud detection added inibexa/core#699. A proxy that is in the ACL keeps passing everything through, which is what a TLS
terminator, load balancer or CDN in front of Varnish relies on.
Applies to
varnish5.vcl,varnish6.vclandvarnish7.vcl.varnish9.vclis deliberately leftout while its own PRs are open; it gets the same treatment once they land.
BC breaks:
varnish5/6/7.vclnow reference thetrusted_proxiesACL, which lives inparameters.vcl. Varnishresolves ACLs at VCL load time, so
parameters.vcland the VCL must be updated together - anexisting
parameters.vclwithout the ACL makes Varnish fail to load withSymbol not found: 'trusted_proxies'. There is no way to make an ACL reference optional in VCL.The ACL ships with localhost only. Anyone running a TLS terminator in front of Varnish has to add
its IP, otherwise the
X-Forwarded-Protoit sets is discarded and URLs are generated ashttp://.Documented in
docs/varnish/README.md.For QA:
Check that https URL generation still works behind a TLS terminator once its IP is added to the
trusted_proxiesACL, and that cache invalidation and theX-Cachedebug headers are unaffected.Easiest done using a custom controller that outputs those headers if they exists, maybe