CVE-2021-20202: Temporary Directory Hijacking Vulnerability in Keycloak
7.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.1393%
CWE
Published
3/18/2022
Updated
2/1/2023
KEV Status
No
Technology
Java
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
org.keycloak:keycloak-core | maven | < 13.0.0 | 13.0.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from using System.getProperty()
("java.io.tmpdir") without proper directory creation safeguards. The patches replace these calls with Platform.getPlatform().getTmpDirectory()
, indicating these were the vulnerable points. All modified functions shared a pattern of creating directories in the system temp location with predictable names and default permissions, making them susceptible to pre-creation attacks. The functions directly handle temporary directory creation and would appear in stack traces when Keycloak
accesses these directories during normal operation or export/import processes.