Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsStudyTraining
ProjectsChecklistsAI RankingsNewsletterStatusTagsAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Study
Training
Projects
Checklists
AI Rankings
Newsletter
Status
Tags
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

884+ Articles
122+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. Security
  3. CVE-2026-39858: Traefik Forwarded-Header Sanitization Bypass in ForwardAuth and Snippet Middleware (CVSS 10.0)
CVE-2026-39858: Traefik Forwarded-Header Sanitization Bypass in ForwardAuth and Snippet Middleware (CVSS 10.0)

Critical Security Alert

This vulnerability is actively being exploited. Immediate action is recommended.

SECURITYCRITICALCVE-2026-39858

CVE-2026-39858: Traefik Forwarded-Header Sanitization Bypass in ForwardAuth and Snippet Middleware (CVSS 10.0)

A second critical CVSS 10.0 authentication bypass in Traefik allows attackers to defeat ForwardAuth and snippet-based authentication middleware by exploiting a flaw in forwarded-header sanitization logic. All versions prior to 2.11.43, 3.6.14, and 3.7.0-rc.2 are affected.

Dylan H.

Security Team

May 1, 2026
6 min read

Affected Products

  • Traefik < 2.11.43
  • Traefik < 3.6.14
  • Traefik < 3.7.0-rc.2

Executive Summary

CVE-2026-39858 is a second critical CVSS 10.0 authentication bypass vulnerability disclosed in Traefik alongside CVE-2026-35051. This vulnerability affects both ForwardAuth and snippet-based authentication middleware and stems from a flaw in Traefik's forwarded-header sanitization logic.

The sanitization logic that should strip or normalize X-Forwarded-* and similar headers targets only canonical header forms, leaving non-canonical representations unprocessed. An attacker can exploit this by sending headers in non-canonical format that bypass sanitization and influence authentication decisions, effectively defeating the authentication layer protecting backend services.

All Traefik deployments using ForwardAuth or snippet-based auth middleware on versions prior to 2.11.43, 3.6.14, or 3.7.0-rc.2 are vulnerable. Both CVE-2026-35051 and CVE-2026-39858 are fixed in the same patch releases.


Vulnerability Overview

AttributeValue
CVE IDCVE-2026-39858
CVSS Score10.0 (Critical)
CWECWE-116 — Improper Encoding or Escaping of Output / Header Sanitization
TypeAuthentication Bypass via Header Injection
Attack VectorNetwork
Privileges RequiredNone
User InteractionNone
Affected ComponentsForwardAuth Middleware, Snippet-based Auth Middleware
Fixed Versions2.11.43, 3.6.14, 3.7.0-rc.2

Affected Versions

BranchAffectedFixed Version
Traefik v2.x< 2.11.432.11.43
Traefik v3.x< 3.6.143.6.14
Traefik v3.7 (RC)< 3.7.0-rc.23.7.0-rc.2

Technical Analysis

Root Cause: Non-Canonical Header Bypass

HTTP header names are case-insensitive per RFC 7230. The canonical form typically uses title-case (e.g., X-Forwarded-For). Traefik's forwarded-header sanitization logic checks and strips headers by matching against their canonical representations.

The vulnerability arises because the sanitization code only checks for canonical header names. Sending the same header with a non-canonical casing (e.g., x-forwarded-for, X-FORWARDED-FOR, or x-ForWaRded-For) causes the header to pass through the sanitization layer unstripped.

Impact on ForwardAuth and Snippet Middleware

ForwardAuth: When Traefik forwards a request to the external authentication service, the sanitization bypass allows attacker-controlled headers to reach the auth service. If the auth service makes trust decisions based on forwarded headers (e.g., trusting X-Forwarded-User), the attacker can impersonate any user or claim arbitrary authentication context.

Snippet-based middleware: Traefik supports inline configuration snippets for authentication logic. The same header sanitization bypass affects snippet-based auth checks, allowing crafted headers to influence snippet execution and bypass authentication decisions.

Attack Flow

1. Attacker identifies a Traefik route protected by ForwardAuth or snippet-based auth
2. Attacker crafts HTTP request with non-canonical forwarded headers:
   e.g., "x-forwarded-user: admin" instead of "X-Forwarded-User: admin"
3. Traefik's sanitization logic checks for "X-Forwarded-User" (canonical) — not found
4. Non-canonical header passes through unsanitized
5. Traefik forwards the request with attacker's "x-forwarded-user: admin" to ForwardAuth
6. ForwardAuth service receives header, treats it as valid, returns 200 OK
7. Traefik grants access to the protected backend as the impersonated user

Relationship to CVE-2026-35051

CVE-2026-35051 and CVE-2026-39858 are related but distinct vulnerabilities disclosed at the same time and fixed in the same releases:

CVE-2026-35051CVE-2026-39858
Root CauseProxy trust configuration interactionNon-canonical header sanitization bypass
TriggertrustForwardHeader=false + upstream proxyAny ForwardAuth/snippet deployment
MechanismHeader stripping logic fails in proxy contextSanitization only checks canonical headers
Affected MiddlewareForwardAuthForwardAuth + Snippet-based auth

Organizations should patch for both vulnerabilities simultaneously as they are fixed in the same releases.


Impact Assessment

Impact AreaDescription
Identity SpoofingAttacker can impersonate any user via crafted forwarded headers
Authentication BypassComplete bypass of ForwardAuth-protected routes
Authorization EscalationClaim admin/elevated roles via forged identity headers
Multi-Tenant ViolationIn multi-tenant deployments, tenant isolation bypassed
Downstream Service CompromiseBackend services receiving spoofed identity may perform privileged operations
Audit Log PoisoningActions performed under spoofed identities appear legitimate in logs

Remediation

Step 1: Update Traefik

# Docker
docker pull traefik:v3.6.14
# or for v2 branch
docker pull traefik:v2.11.43
 
# Kubernetes with Helm
helm repo update
helm upgrade traefik traefik/traefik \
  --set image.tag=v3.6.14 \
  -n traefik
 
# Binary install — download patched binary from Traefik releases
curl -L https://github.com/traefik/traefik/releases/download/v3.6.14/traefik_v3.6.14_linux_amd64.tar.gz \
  -o traefik.tar.gz && tar -xzf traefik.tar.gz

Step 2: Verify the Patch Is Applied

# Confirm running version
traefik version
# Expected output: Version: v3.6.14 (or v2.11.43)
 
# Or via API
curl http://localhost:8080/api/version

Step 3: Harden Header Processing

After patching, review and harden forwarded-header handling across all middleware:

# dynamic.yml — ForwardAuth hardening
http:
  middlewares:
    auth-hardened:
      forwardAuth:
        address: "https://auth.internal/verify"
        # Explicitly allowlist headers to pass to auth service
        authRequestHeaders:
          - "Authorization"
          - "X-Request-Id"
        # Restrict headers copied back from auth service
        authResponseHeaders:
          - "X-Auth-User"
          - "X-Auth-Role"
        # Do not pass arbitrary forwarded headers
        trustForwardHeader: false

Step 4: Audit Authentication Service Header Trust

Review your ForwardAuth service to ensure it validates headers securely:

# Example: Harden auth service to only trust headers Traefik explicitly injects
# Never trust X-Forwarded-User or similar from the incoming request
# Instead, set identity in authResponseHeaders from your own validation logic
 
def verify_request(request):
    # Only trust the Authorization header or session token
    # Do NOT trust X-Forwarded-User, X-Real-IP as identity claims
    token = request.headers.get("Authorization")
    if not token:
        return 401, {}
    
    user = validate_token(token)
    if not user:
        return 401, {}
    
    # Return identity via response headers that Traefik will forward
    return 200, {"X-Auth-User": user.id, "X-Auth-Role": user.role}

Detection

IndicatorDescription
Requests with non-canonical header casing in access logsPotential exploitation probe
Unexpected user identities in backend service logsPost-bypass activity
ForwardAuth service receiving requests with identity headersHeader injection attempt
Access to protected routes with missing or anomalous auth tokensBypass succeeded

Search Traefik access logs for non-canonical header patterns:

# Look for lowercase x-forwarded headers that should be stripped
grep -i '"x-forwarded-user":\|"x-forwarded-email":' /var/log/traefik/access.log | \
  grep -v '"X-Forwarded-User":' | head -50
 
# Look for authentication bypasses (requests reaching backend without expected auth headers)
grep '"user":""' /var/log/traefik/access.log | tail -100

Post-Remediation Checklist

  1. Patch Traefik to version 2.11.43, 3.6.14, or 3.7.0-rc.2
  2. Patch both CVEs — CVE-2026-35051 and CVE-2026-39858 are fixed in the same releases
  3. Review all ForwardAuth and snippet-based middleware configurations
  4. Harden auth service to avoid trusting forwarded identity headers from incoming requests
  5. Audit logs for non-canonical header patterns indicating prior exploitation
  6. Revoke sessions for any services that may have been accessed via bypassed auth
  7. Test end-to-end authentication flows post-patch

References

  • NVD — CVE-2026-39858
  • NVD — CVE-2026-35051 (related)
  • Traefik GitHub — Security Advisories
  • RFC 7230 — HTTP/1.1 Message Syntax (Header Field Names)
#CVE-2026-39858#Traefik#Authentication Bypass#ForwardAuth#Header Injection#Middleware Bypass#CVSS 10

Related Articles

CVE-2026-35051: Traefik ForwardAuth Authentication Bypass via Proxy Trust Abuse (CVSS 10.0)

A critical CVSS 10.0 authentication bypass in Traefik's ForwardAuth middleware allows attackers to circumvent authentication when the proxy is deployed behind a trusted upstream. Versions prior to 2.11.43, 3.6.14, and 3.7.0-rc.2 are affected.

5 min read

Juju Dqlite Cluster TLS Auth Bypass — Unauthenticated Database Access (CVE-2026-4370)

A CVSS 10.0 critical vulnerability in Juju versions 3.2.0–3.6.18 and 4.0–4.0.3 allows unauthenticated attackers to connect directly to the internal Dqlite...

6 min read

CVE-2026-41940: WebPros cPanel & WHM and WP2 Missing Authentication Vulnerability

WebPros cPanel, WHM, and WP2 (WordPress Squared) contain a critical authentication bypass in the login flow, allowing unauthenticated remote attackers to gain unauthorized access to the hosting control panel. Added to CISA KEV as actively exploited.

6 min read
Back to all Security Alerts