CVE-2021-3856 is a medium-severity (CVSS 4.3) CWE-552 vulnerability in org.keycloak:keycloak-core. A fix is available for org.keycloak:keycloak-core — see the affected versions and patch details below.
Keycloak has Files or Directories Accessible to External Parties
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
org.keycloak:keycloak-coreReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.keycloak:keycloak-core | all versions | 15.1.0org.keycloak:keycloak-core:15.1.0 |
Affected Products
keycloakredhatDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.keycloak:keycloak-core, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update org.keycloak:keycloak-core to 15.1.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-3856 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Single Sign-On 7.6 for RHEL 7 | rh-sso7-0:1-4.el7sso | RHBA-2022:5452 |
| Red Hat Single Sign-On 7.6 for RHEL 8 | rh-sso7-0:1-4.el8sso | RHBA-2022:5454 |
Frequently Asked Questions
Is CVE-2021-3856 in your dependencies?
Find it across Maven, including transitive dependencies.