Skip to content

XSS in Authentik via JavaScript-URI as Redirect URI and form_post Response Mode

High
BeryJu published GHSA-rjpr-7w8c-gv3j Jan 9, 2024

Package

authentik

Affected versions

<= 2023.10.5
<= 2023.8.5

Patched versions

2023.10.6
2023.8.6

Description

Summary

Given an OAuth2 provider configured with allowed redirect URIs set to * or .*, an attacker can send an OAuth Authorization request using response_mode=form_post and setting redirect_uri to a malicious URI, to capture authentik's session token.

Patches

authentik 2023.8.6 and 2023.10.6 fix this issue.

Impact

The impact depends on the attack scenario. In the following I will describe the two scenario that were identified for Authentik.

Redirect URI Misconfiguration

While advising that this may cause security issues, Authentik generally allows wildcards as Redirect URI. Therefore, using a wildcard-only effectively allowing arbitrary URLS is possible misconfiguration that may be present in real-world instances.

In such cases, unauthenticated and unprivileged attackers can perform the above described actions.

User with (only) App Administration Permissions

A more likely scenario is an administrative user (e.g. a normal developer) having only permissions to manage applications.

This relatively user could use the described attacks to perform a privilege escalation.

Workaround

It is recommended to upgrade to the patched version of authentik. If not possible, ensure that OAuth2 providers do not use a wildcard (* or .*) value as allowed redirect URI setting. (This is not exploitable if part of the redirect URI has a wildcard, for example https://foo-.*\.bar\.com)

For more information

If you have any questions or comments about this advisory:

Severity

High

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
High
User interaction
Required
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:H/UI:R/S:C/C:H/I:H/A:H

CVE ID

CVE-2024-21637

Weaknesses

Credits