MEDIUM 5.8

CVE-2026-54764: Traefik ForwardAuth Header Injection Authorization Bypass

Traefik's ForwardAuth middleware has a header validation flaw that allows attackers to spoof authorization checks. When an attacker sends a specially crafted HTTP request with a fake HTTPS header, Traefik incorrectly forwards a port number (443) to the authentication service—even when the actual connection is plain HTTP. This mismatch can trick the auth service into granting access to users who should be blocked based on port-level restrictions. The vulnerability exists because Traefik uses the attacker-controlled header instead of the actual connection details, bypassing the trustForwardHeader safety setting that administrators may have configured.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.8 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N
Weaknesses (CWE)
CWE-345
Affected products
1 configuration(s)
Published / Modified
2026-07-06 / 2026-07-08

NVD description (verbatim)

Traefik is an HTTP reverse proxy and load balancer. Prior to v2.11.51, v3.6.22, and v3.7.6, Traefik's ForwardAuth middleware, even when configured with trustForwardHeader: false, derives the X-Forwarded-Port header sent to the authentication service from the original incoming request instead of the sanitized forwarded request. As a result, an unauthenticated remote attacker can inject an X-Forwarded-Proto: https header over a plain HTTP connection and cause Traefik to forward X-Forwarded-Port: 443 to the authentication service, bypassing port-based authorization checks. This issue is fixed in versions v2.11.51, v3.6.22, and v3.7.6.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-54764 is a header injection vulnerability in Traefik's ForwardAuth middleware affecting versions prior to v2.11.51, v3.6.22, and v3.7.6. The flaw stems from improper header sanitization in the authentication forwarding logic. When trustForwardHeader is set to false (intended to reject untrusted X-Forwarded-* headers from upstream proxies), the middleware still derives X-Forwarded-Port from the original request headers rather than from the actual TLS/TCP context. An attacker can inject X-Forwarded-Proto: https over a plain HTTP connection; Traefik then forwards X-Forwarded-Port: 443 to the backend authentication service. This allows circumvention of port-based access control policies that depend on the auth service receiving the correct port number. The vulnerability is classified as an Insecure Deserialization variant (CWE-345) due to the trust placed in unvalidated forwarded headers.

Business impact

For organizations using Traefik with port-based or protocol-aware authentication rules, this vulnerability enables unauthorized access to protected services. If an authentication service relies on X-Forwarded-Port to enforce policies (e.g., 'allow HTTPS but block HTTP'), an attacker can forge the header and bypass those controls. Exposure depends on how strictly port-based authorization is enforced downstream; services that do not validate port-level policies are not affected. The impact is particularly significant for multi-tenant environments, API gateways, and microservices deployments where Traefik acts as the primary ingress controller.

Affected systems

Traefik versions prior to v2.11.51 (v2.x branch), v3.6.22 (v3.6.x branch), and v3.7.6 (v3.7.x branch) are vulnerable. All deployments running unpatched versions with ForwardAuth middleware enabled are at risk, regardless of the trustForwardHeader setting. The vulnerability does not require specific network configuration or authentication backend type; it affects any setup where Traefik forwards headers to an authentication service that validates port-level access.

Exploitability

The attack is trivial to execute and requires no authentication. An unauthenticated remote attacker can craft a single malicious HTTP request with a spoofed X-Forwarded-Proto header, no special privileges or access to internal systems. The vulnerability is not currently tracked in the CISA KEV catalog, suggesting limited evidence of active exploitation at the time of publication, though the ease of exploitation and visibility of Traefik in cloud-native architectures present a meaningful risk. The CVSS 3.1 score of 5.8 (MEDIUM) reflects the network-accessible attack vector, low complexity, and integrity impact, tempered by the requirement for a specific authentication configuration and the lack of confidentiality or availability impact.

Remediation

Upgrade to Traefik v2.11.51, v3.6.22, or v3.7.6 or later, depending on which branch you operate. Verify the patched version against the vendor advisory before deployment. Temporary mitigations prior to patching include: (1) Disabling ForwardAuth if port-based access controls are not required, (2) Configuring upstream reverse proxies or WAF rules to strip or validate X-Forwarded-Proto headers before they reach Traefik, and (3) Implementing port-validation logic in your authentication service to reject mismatches between the claimed X-Forwarded-Port and the actual connection port.

Patch guidance

Apply updates in the following order by version branch: v2.11.51 or later for the v2.x line, v3.6.22 or later for v3.6.x, and v3.7.6 or later for v3.7.x. Test in a staging environment before deploying to production to ensure ForwardAuth behavior remains consistent. Monitor authentication logs post-patch for any anomalies. If you are on a legacy v2.x version, consider planning a roadmap to v3.x in the medium term for long-term support and security updates.

Detection guidance

Monitor Traefik logs for X-Forwarded-Proto: https headers arriving over non-TLS connections. Correlate authentication service logs with Traefik forwarding logs to detect cases where X-Forwarded-Port does not match the actual connection port. Implement intrusion detection rules to flag HTTP requests containing X-Forwarded-Proto: https with high confidence. Review recent authentication logs for anomalous port values (e.g., port 443 claims on HTTP connections) that may indicate successful exploitation attempts.

Why prioritize this

Although the CVSS score is MEDIUM (5.8), the ease of exploitation and the widespread use of Traefik in modern cloud-native and Kubernetes deployments warrant rapid patching. The vulnerability is not (as of publication) in active exploitation, providing a window to update before threat actors systematize attacks. Organizations relying on port-based authorization should treat this as HIGH priority; others with port-agnostic auth rules may deprioritize but should still patch within standard maintenance cycles.

Risk score, explained

The CVSS 3.1 score of 5.8 reflects a network-accessible attack (AV:N), low attack complexity (AC:L), no privilege requirement (PR:N), and no user interaction (UI:N). Integrity is slightly impacted (I:L) because unauthorized access modifies the security decision. Scope is changed (S:C) because the attack affects the confidentiality model of the authentication service. The score does not escalate to HIGH due to lack of direct confidentiality or availability impact on Traefik itself; however, downstream access control bypass (the true impact) is significant in many real-world deployments.

Frequently asked questions

Does this vulnerability affect Traefik if trustForwardHeader is already set to false?

Yes. The trustForwardHeader setting controls validation of X-Forwarded-* headers in general, but it does not prevent the middleware from using the original request headers to derive X-Forwarded-Port when forwarding to the auth service. The flaw bypasses the protection that trustForwardHeader is intended to provide.

Can this vulnerability be exploited if my authentication service does not check port numbers?

No. If your authentication service ignores or does not validate X-Forwarded-Port, the attacker's spoofed port will not influence access decisions. However, you should still patch because authentication services that do perform port-level checks—whether now or in the future—would then be vulnerable.

What is the difference between X-Forwarded-Proto and X-Forwarded-Port in this context?

X-Forwarded-Proto indicates the protocol (http or https), while X-Forwarded-Port indicates the port number (e.g., 80, 443). An attacker injects X-Forwarded-Proto: https to trigger Traefik's logic, which then incorrectly forwards port 443. The authentication service receives a mismatch: 'https on port 443' via forwarded headers, but the actual connection may be HTTP on port 8080, allowing a bypass.

Is this vulnerability exploitable only over plain HTTP, or does it apply to HTTPS connections as well?

The primary exploit vector is over plain HTTP, where an attacker injects a fake https header. Over legitimate HTTPS, the attacker cannot spoof the protocol since TLS termination at Traefik would set X-Forwarded-Proto correctly. However, any misconfiguration that causes Traefik to trust upstream headers could expand the risk surface.

This analysis is provided for informational purposes and reflects the state of the vulnerability as of publication. Organizations should verify patch availability and compatibility with their specific Traefik versions and deployments against the official vendor advisory. No exploit code or weaponized proof-of-concept is provided. Users are responsible for assessing risk in their own environments and applying updates according to their change management policies. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).