VYPR
Critical severityNVD Advisory· Published Jan 11, 2023· Updated Apr 9, 2025

CVE-2022-3782

CVE-2022-3782

Description

keycloak: path traversal via double URL encoding. A flaw was found in Keycloak, where it does not properly validate URLs included in a redirect. An attacker can use this flaw to construct a malicious request to bypass validation and access other URLs and potentially sensitive information within the domain or possibly conduct further attacks. This flaw affects any client that utilizes a wildcard in the Valid Redirect URIs field.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Keycloak fails to validate double URL-encoded redirect URIs, allowing path traversal and potential access to sensitive endpoints.

Vulnerability

Overview

CVE-2022-3782 is a path traversal vulnerability in Keycloak caused by improper validation of redirect URIs. The flaw occurs when Keycloak does not correctly decode URLs that have been double URL-encoded (e.g., %252E%252E representing ../ after two decoding passes). This allows an attacker to bypass the intended URI validation and redirect users to arbitrary paths within the same domain [1][2].

Exploitation

An attacker can exploit this vulnerability by crafting a malicious redirect URI that uses double encoding to represent path traversal sequences. The attack requires that the targeted Keycloak client has a wildcard (*) configured in the "Valid Redirect URIs" field. The attacker must also be able to lure a victim into clicking a crafted link or initiate an OAuth flow with the malicious redirect URI [2]. The vulnerability is demonstrated in the test cases added in the fix commit, which show that double-encoded ../ sequences were incorrectly accepted before the patch [3].

Impact

Successful exploitation allows an attacker to perform path traversal, accessing other URLs within the same domain that were not intended to be reachable via redirects. This could lead to disclosure of sensitive information, such as internal endpoints or authentication tokens, and potentially enable further attacks like open redirect or cross-site scripting (XSS) if combined with other weaknesses [1][2].

Mitigation

The vulnerability has been addressed in Keycloak releases 20.0.3 and 21.0.0, where the redirect URI validation now correctly handles multiple layers of URL encoding [3]. Users should update to these or later versions. For clients that cannot upgrade immediately, administrators should review and restrict the use of wildcard redirect URIs as a precautionary measure [1].

AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
org.keycloak:keycloak-parentMaven
< 20.0.220.0.2

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

5

News mentions

0

No linked articles in our index yet.