CVE-2021-3856 Keycloak has Files or Directories Accessible to External Parties

Medium 4.3 Published Updated

Attackers can read arbitrary files accessible to the classloader by manipulating theme resource requests, exposing sensitive data.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-3856?

CVE-2021-3856 is a medium-severity path traversal vulnerability in Redhat Keycloak, published on 26 Aug 2022. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

ClassLoaderTheme and ClasspathThemeResourceProviderFactory allows reading any file available as a resource to the classloader. By sending requests for theme resources with a relative path from an external HTTP client, the client will receive the content of random files if available.

Weakness: CWE-22, CWE-552

Which versions are affected by CVE-2021-3856?

2 open source packages ship an affected version, including org.keycloak:keycloak-core. It affects 1 product.

PackageAffectedFixed in
org.keycloak:keycloak-core MavenAll versions15.1.0
org.keycloak:keycloak-core MavenAll versions15.1.0

Products include Redhat Keycloak.

How do I fix CVE-2021-3856?

Upgrade org.keycloak:keycloak-core to 15.1.0 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2021-3856 being exploited?

There is no known exploitation of CVE-2021-3856 in the wild and no public exploit code.

All Redhat Keycloak vulnerabilities

Sources

Also known as GHSA-3w4v-rvc4-2xpw.

Is CVE-2021-3856 in your software?

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

Check your SBOMs for free