Trusted upstream forwarded headers are dropped when forwarded filter is disabled

Aperta
#4,227 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #4231 di @hutiefang76 — chiusa senza merge

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
java, spring, spring-boot
Ambito
api, backend, security

Direzione di ricerca

Riproduci la topologia Kubernetes segnalata utilizzando il progetto di esempio all’indirizzo https://github.com/gbaso/spring-cloud-gateway-forwarded e confronta il comportamento tra le versioni interessate. Inizia tracciando il forwarded-header filter e la relativa configurazione di trust; il lavoro è completo quando la gestione degli header upstream attendibili è verificata e coperta per questa configurazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

for team discussion

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

https://github.com/gbaso/spring-cloud-gateway-forwarded

Lingua principale
Java
Stelle
4.9k
Fork
3.5k
Merge medio
1g 13h
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di spring-cloud/spring-cloud-gateway

Tutte le issue di spring-cloud/spring-cloud-gateway

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.