Spoofing of X-Forwarded-Host header is possible during redirect to HTTPS #13158
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-priority
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
What happened:
It is possible to spoof the X-Forwarded-Host header during the HTTP to HTTPS redirect in Ingress NGINX. This may allow an attacker to manipulate the redirect behavior by providing a malicious or incorrect X-Forwarded-Host value.
What you expected to happen:
Ingress NGINX should properly handle the X-Forwarded-Host header and prevent it from being spoofed. X-Forwarded headers should only be considered safe from the CIDR ranges defined in property proxy-real-ip-cidr.
NGINX Ingress controller version (exec into the pod and run
/nginx-ingress-controller --version
):Kubernetes version (use
kubectl version
):1.32
Environment:
uname -a
):Linux ingress-nginx-gh-controller-649f86695b-7bsm2 6.1.124 #1 SMP PREEMPT_DYNAMIC Sat Jan 25 00:17:27 UTC 2025 x86_64 Linux
Client Version: v1.32.3 Kustomize Version: v5.5.0 Server Version: v1.32.2-eks-bc803b4
How was the ingress-nginx-controller installed:
helm ls -A | grep -i ingress
ingress-nginx xxx 7 2025-03-06 05:24:31.654774386 +0000 UTC deployed ingress-nginx-4.12.0 1.12.0
helm -n <ingresscontrollernamespace> get values <helmreleasename>
How to reproduce this issue:
Note that the request needs to be via HTTP and not HTTPS to reproduce the redirect.
Result:
The text was updated successfully, but these errors were encountered: