CVE-2022-3782 Keycloak vulnerable to path traversal via double URL encoding
Attackers can bypass redirect validation via double URL encoding to access sensitive internal URLs in Keycloak instances using wildcard redirect URIs.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-3782?
CVE-2022-3782 is a critical path traversal vulnerability in Redhat Keycloak, published on 11 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-22
Which versions are affected by CVE-2022-3782?
2 open source packages ship an affected version, including org.keycloak:keycloak-parent. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.keycloak:keycloak-parent Maven | All versions | 20.0.2 |
org.keycloak:keycloak-parent Maven | All versions | 20.0.2 |
Products include Redhat Keycloak.
How do I fix CVE-2022-3782?
Upgrade org.keycloak:keycloak-parent to 20.0.2 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2022-3782 being exploited?
There is no known exploitation of CVE-2022-3782 in the wild and no public exploit code.
Public exploit code: 1 proofs of concept on GitHub.
Other vulnerabilities in Redhat Keycloak
- CVE-2022-4361 Keycloak vulnerable to cross-site scripting when validating URI-schemes on SAML and OIDC
- CVE-2022-1245 Keycloak vulnerable to privilege escalation on Token Exchange feature
- CVE-2021-20195 keycloak Self Stored Cross-site Scripting vulnerability
- CVE-2019-14910 Keycloak Authentication Error
- CVE-2019-14909 Keycloak Authentication Error
Sources
Also known as GHSA-g8q8-fggx-9r3q.