spring-cloud / spring-cloud/spring-cloud-gateway

XForwardedHeadersFilter does not add X-Forwarded-For when remote address is an IPv6

Open
#3,644 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
4.9k
Forks
3.5k
Avg merge
20h 57m
Merged PRs (30d)
8

Description

This is a continuation of the Forwarded headers bug, but this time for XForwardedFilter

After adding property spring.cloud.gateway.forwarded.enabled=false to https://github.com/ZIRAKrezovic/gateway-reproducer, XForwardedFilter check for remote address fails when IPv6 is parsed as remote address

{4B52290E-5E1C-4D5D-9951-4B0FE5B482A7}

{7FDCCF7E-7017-4A74-9183-804966D9BA3F}

Last conditional will fail, and X-Forwarded-For will not be added to the request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at XForwardedFilter and inspect the conditional that checks the remote address, using the gateway-reproducer configuration described in the issue to reproduce the IPv6 case. Completion means X-Forwarded-For is added when the remote address is IPv6, while the existing behavior for other remote addresses remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.