/

CVE-2026-25748

Severity:

HIGH RISK

(8.6)

Authentication Bypass in authentik Proxy Provider Forward

CVE-2026-25748

Analyzed

Vulnerability type

Category:

Authentication Bypass

CWE:

CWE-287

Impact:

Unauthorized Access / Authentication Bypass

Severity:

HIGH RISK

(8.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An authentication bypass issue in authentik's Proxy Provider forward-auth flow can occur when a maliciously crafted cookie is processed behind Traefik or Caddy.

Under certain malformed cookie conditions, authentik fails to set the expected X-Authentik-* headers, which some backend applications may interpret as successful authentication, potentially granting unauthorized access.

Affected context

This vulnerability arises in deployments that:

  • Use authentik as an identity provider with the Proxy Provider in forward authentication mode
  • Are fronted by reverse proxies such as Traefik or Caddy
  • Rely on presence or specific values of X-Authentik-* headers for access control decisions

In this context, a specially malformed cookie can cause authentik to skip or fail header injection, leaving downstream services to incorrectly treat the request as authenticated or to apply overly permissive defaults.

Exploit preconditions

  • Attack surface: HTTP(S) endpoints protected by authentik Proxy Provider using forward authentication.
  • Required access: Network access to the protected application through Traefik or Caddy (no prior authentication required).
  • Trigger point: Sending requests with a specially malformed or crafted cookie that interferes with authentik's forward-auth handling.
  • Why exploitation is possible: The forward-auth integration and header injection logic do not robustly handle malformed cookies. When processing fails, X-Authentik-* headers are not set, and some backend applications or proxy rules may treat such requests as authenticated or skip enforcement, resulting in an authentication bypass.

Why this happens

The underlying issue maps to CWE-287: Improper Authentication.

The authentication flow depends on a combination of cookies and injected X-Authentik-* headers. When presented with malformed cookie data in the forward-auth context, authentik's logic does not ensure a fail-closed behavior. Instead of reliably denying access or signaling an error when it cannot validate the session, it may omit the expected headers without enforcing an explicit deny response.

This creates an ambiguous state where downstream components, expecting a consistent contract (e.g., presence or absence of specific headers), may incorrectly infer that the request is authenticated or fall back to permissive defaults. Conceptually, the bug is an inconsistent enforcement of authentication guarantees when input deviates from expected cookie formats.

Potential impact

  • Unauthorized access to applications believed to be protected by authentik forward authentication
  • Exposure of internal dashboards, admin interfaces, or APIs behind Traefik/Caddy
  • Abuse of authenticated-only features such as data export, configuration changes, or user operations
  • Lateral movement opportunities once an attacker reaches internal or higher-trust services
  • Potential compliance violations due to access control breakdown

General mitigation guidance

Defenses should focus on ensuring fail-closed authentication behavior and reinforcing trust boundaries between authentik, reverse proxies, and backend apps:

  • Design forward-auth integrations so that missing or malformed X-Authentik-* headers result in an explicit deny decision by the proxy or application.
  • Treat all client-provided cookies as untrusted input; validate and normalize cookie parsing paths, and handle malformed cookies by rejecting the request rather than downgrading checks.
  • In reverse proxy configuration, explicitly require expected authentication headers and return an error or redirect if they are absent or inconsistent.
  • Apply least-privilege principles at the backend: enforce access control in the application layer as well, not only at the proxy, and avoid assuming that traffic from a given proxy is inherently authenticated.
  • Implement defense-in-depth by combining header-based auth with additional checks (e.g., session validation endpoints, strict audience checks) where appropriate.

How teams detect issues like this

Identification typically involves reviewing both code and configuration for authentication assumptions:

  • Static / configuration analysis:
  • Search for routes or services that rely solely on the presence of X-Authentik-* headers without validating their semantics or handling absent headers explicitly.
  • Flag proxy rules where access is allowed by default and only restricted when specific headers are present (instead of the inverse).
  • Review cookie parsing and session handling code paths for error handling around malformed cookies, ensuring they return deny/redirect on parse failures.
  • Code review signals:
  • Authentication paths that can exit early without issuing a clear deny or redirect on unexpected cookie formats.
  • Conditional logic that sets authentication headers without corresponding negative paths when validation fails.
  • Runtime / monitoring approaches:
  • Analyze logs for requests that reach protected backends without X-Authentik-* headers or with inconsistent combinations of such headers.
  • Use security testing and fuzzing tools to send malformed cookies through forward-auth endpoints and observe whether backends still become reachable.

Automated review tools and policy-as-code frameworks can help enforce "fail-closed on missing auth headers" patterns in proxy and gateway configurations.

Sources

SourceLink
github.comgithub.com/goauthentik/authentik/releases/tag/version%2F2025.10.4
github.comgithub.com/goauthentik/authentik/releases/tag/version%2F2025.12.4
github.comgithub.com/goauthentik/authentik/security/advisories/GHSA-fj56-5763-j8pp

Frequently asked

questions

Exploitability depends on deployment: if your applications or proxy rules treat missing or inconsistent X-Authentik-* headers as acceptable and do not explicitly deny such requests, an attacker with network access to the protected endpoint may bypass authentication using crafted cookies.

Not necessarily. The issue arises from malformed cookie handling and header injection. In many configurations, an attacker only needs network access to the reverse proxy and the ability to send arbitrary HTTP requests with crafted cookies.

Ensure the entire stack behaves fail-closed: when authentik encounters invalid or malformed cookies, it should deny or redirect rather than proceed ambiguously; likewise, Traefik/Caddy and backend applications should reject any request that lacks valid X-Authentik-* headers or presents them in an invalid state.

Standardize authentication contracts between IdPs, proxies, and services: strictly validate headers, never treat their absence as success, and explicitly handle error conditions. Combine secure coding practices for session/cookie parsing with hardened proxy rules, regression tests for malformed input, and routine security reviews of authentication flows.

Find out what's already
exploitable in your codebase.