CVE-2021-3856 Keycloak has Files or Directories Accessible to External Parties
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.
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.
| Package | Affected | Fixed in |
|---|---|---|
org.keycloak:keycloak-core Maven | All versions | 15.1.0 |
org.keycloak:keycloak-core Maven | All versions | 15.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.
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-3w4v-rvc4-2xpw.