CVE-2022-3782 Keycloak vulnerable to path traversal via double URL encoding

Critical 9.1 Published Updated

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.

PackageAffectedFixed in
org.keycloak:keycloak-parent MavenAll versions20.0.2
org.keycloak:keycloak-parent MavenAll versions20.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.

All Redhat Keycloak vulnerabilities

Sources

Also known as GHSA-g8q8-fggx-9r3q.

Is CVE-2022-3782 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free