spring-cloud / spring-cloud/spring-cloud-gateway
Trusted upstream forwarded headers are dropped when forwarded filter is disabled
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
Describe the bug
In version 2025.1.2 / 2025.0.3 a new filter was added to remove existing forwarded headers when the gateway does not have forwarding support enabled, or does not trust upstream proxies. However this broke my k8s setup:
- an edge api gateway which adds forwarded headers
- a second gateway, downstream from edge, which is used to route requests to different containers in the same pod
- a container in the same pod as the internal gateway
In this setup the internal gateway does not add forwarded headers, as they would only refer to internal resources, and they are not relevant. It, however, trusts the upstream edge gateway.
In previous versions this worked as expected, but it broke with the last update.
Is this behavior intended (perhaps as part of CVE-2026-47825)? If so, what is the correct way to support use cases like mine?
Sample
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported Kubernetes topology using the sample project at https://github.com/gbaso/spring-cloud-gateway-forwarded and compare behavior across the affected versions. Start by tracing the forwarded-header filter and its trust configuration; done means the handling of trusted upstream headers is verified and covered for this setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- api, backend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100