Skip to content

Password authentication bypass via X-Forwarded-For HTTP header

Critical
BeryJu published GHSA-7jxf-mmg9-9hg7 Sep 27, 2024

Package

authentik

Affected versions

<= 2024.8.2
<= 2024.6.4

Patched versions

2024.8.3
2024.6.5

Description

Password authentication bypass via X-Forwarded-For HTTP header

Summary

The vulnerability allows bypassing policies by adding X-Forwarded-For header with unparsable IP address, e.g. "a". This results in a possibility to authenticate/authorize to any account with known login or email address.

Since the default authentication flow uses a policy to only enable the password stage when there is no password stage selected on the Identification stage, this vulnerability can be used to skip this policy and continue without the password stage.

Am I affected

This can be exploited for the following configurations:

  • An attacker can access authentik without a reverse proxy (and AUTHENTIK_LISTEN__TRUSTED_PROXY_CIDRS is not configured properly)
  • The reverse proxy configuration does not correctly overwrite X-Forwarded-For
  • Policies (User and group bindings do not apply) are bound to authentication/authorization flows

Patches

authentik 2024.6.5 and 2024.8.3 fix this issue.

Workarounds

Ensure the X-Forwarded-For header is always set by the reverse proxy, and is always set to a correct IP.

In addition you can manually change the Failure result option on policy bindings to Pass, which will prevent any stages from being skipped if a malicious request is received.

For more information

If you have any questions or comments about this advisory:

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H

CVE ID

CVE-2024-47070

Weaknesses

Credits