Skip to content

IBX-11181: Filtered client-supplied X-Forwarded-* headers in Varnish VCL - #108

Open
vidarl wants to merge 7 commits into
4.6from
IBX-11181-Trusted_Proxies_is_not_set_on_Ibexa_Cloud
Open

vidarl wants to merge 7 commits into
4.6from
IBX-11181-Trusted_Proxies_is_not_set_on_Ibexa_Cloud

Conversation

@vidarl

@vidarl vidarl commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor
Question Answer
JIRA issue IBX-11181
Type bug
Target Ibexa version v4.6
BC breaks no

Related PRs:

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 a
client sends is believed by Symfony, so the VCL has to stop them from reaching the application.

Per the Upsun header documentation the
router is authoritative for X-Forwarded-Proto, X-Client-IP and Client-Cdn, and discards
whatever the client sent for them. It says nothing about X-Forwarded-Host, X-Forwarded-Prefix or
RFC 7239 Forwarded, and states that it otherwise passes request headers through - so those three
arrive client controlled and are now stripped.

X-Forwarded-For needed more care. Without a CDN the router only appends the real client IP to
whatever the client sent, so every leading entry is client controlled. X-Client-IP is authoritative
in both the CDN and the non-CDN case, so it becomes the sole value of X-Forwarded-For. If it is
absent the request did not come through the router at all, and the header is dropped.

No trusted_proxies ACL here, unlike the VCLs in ibexa/http-cache: client.ip is not reliable on
Upsun, where REMOTE_ADDR is spoofed to the end user IP.

For QA:

Check that https URL generation still works behind a TLS terminator once its IP is added to the
trusted_proxies ACL, and that cache invalidation and the X-Cache debug headers are unaffected.
Easiest done using a custom controller that outputs those headers if they exists, maybe

Checklist:

  • Provided PR description.
  • Tested the solution manually.
  • Provided automated test coverage.
  • Checked that target branch is set correctly (main for features, the oldest supported for bugs).
  • Ran PHP CS Fixer for new PHP code (use $ composer fix-cs).
  • Asked for a review (ping @ibexa/engineering).

@konradoboza
konradoboza requested a review from a team September 11, 2026 07:13
@vidarl
vidarl force-pushed the IBX-11181-Trusted_Proxies_is_not_set_on_Ibexa_Cloud branch from fbc396a to 774863e Compare October 8, 2026 10:14
@micszo
micszo removed their request for review October 8, 2026 12:17
@vidarl
vidarl force-pushed the IBX-11181-Trusted_Proxies_is_not_set_on_Ibexa_Cloud branch 2 times, most recently from 771bdc5 to 0616cf9 Compare October 12, 2026 11:58
@vidarl
vidarl force-pushed the IBX-11181-Trusted_Proxies_is_not_set_on_Ibexa_Cloud branch 2 times, most recently from d720e1f to 6e28043 Compare October 14, 2026 10:35
Comment thread .github/workflows/backend-ci.yaml Outdated

- name: Run varnishtest suite
env:
IMAGE: ibexa-varnishtest:6.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

arent we missing VCL: resources/platformsh/common/4.6/.platform/varnish9.vcl here as well? I know, there is default fallback to it, but it will be easier to fix on merge up?

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