CVE-2020-15824 Overview
CVE-2020-15824 is a privilege escalation vulnerability in JetBrains Kotlin affecting versions from 1.4-M1 to 1.4-RC. The vulnerability exists due to improper handling of kotlin-main-kts cached scripts, which are stored in the system temporary directory. Since this directory is shared by all users by default on most operating systems, a low-privileged attacker can manipulate cached scripts to escalate privileges when another user executes Kotlin scripts.
Critical Impact
Low-privileged attackers can leverage shared temp directory script caching to achieve privilege escalation, potentially gaining elevated access to confidential data or system integrity through network-accessible exploitation.
Affected Products
- JetBrains Kotlin 1.4.0 Milestone 1 (1.4-M1)
- JetBrains Kotlin 1.4.0 Milestone 2 (1.4-M2)
- JetBrains Kotlin 1.4.0 Milestone 3 (1.4-M3)
- JetBrains Kotlin 1.4.0 Release Candidate (1.4-RC)
- Oracle Banking Extensibility Workbench 14.2, 14.3, 14.5
- Oracle Communications Cloud Native Core Policy 1.14.0
Discovery Timeline
- August 8, 2020 - CVE-2020-15824 published to NVD
- November 21, 2024 - Last updated in NVD database
Technical Details for CVE-2020-15824
Vulnerability Analysis
This privilege escalation vulnerability (CWE-269: Improper Privilege Management) arises from an insecure design decision in how Kotlin handles script caching. When users execute Kotlin scripts using the kotlin-main-kts script runner, the compiled script classes are cached in the system's temporary directory (commonly /tmp on Unix systems or %TEMP% on Windows).
The fundamental issue is that this cache location is accessible to all users on the system by default. When a higher-privileged user executes a Kotlin script that has been previously cached, the cached version may have been tampered with by a lower-privileged attacker who has write access to the shared temporary directory.
Kotlin versions 1.3.7x are not affected by this issue, and the vulnerability was fixed in Kotlin version 1.4.0. The fix ensures that cached scripts are stored in a user-specific location with appropriate permissions, preventing cross-user cache manipulation.
Root Cause
The root cause is improper privilege management in the Kotlin script caching mechanism. The kotlin-main-kts component stores compiled script cache files in a world-writable system temporary directory without proper user isolation or integrity verification. This allows any local user to create, modify, or replace cached script files that may subsequently be loaded and executed by other users with different privilege levels.
Attack Vector
The attack vector is network-based according to the CVSS classification, though the exploitation requires local access to the shared cache directory. An attacker with low privileges on a multi-user system can exploit this vulnerability by:
- Identifying Kotlin scripts that are likely to be executed by privileged users
- Pre-populating or modifying the script cache in the shared temporary directory with malicious compiled code
- Waiting for a higher-privileged user to execute the targeted Kotlin script
- The victim's Kotlin runtime loads the poisoned cache, executing the attacker's code with the victim's privileges
This attack is particularly effective in enterprise environments where multiple developers or administrators share access to development or build servers.
Detection Methods for CVE-2020-15824
Indicators of Compromise
- Unexpected modifications to files in the system temp directory with patterns matching kotlin-main-kts cache files
- Anomalous file creation or modification timestamps in /tmp or %TEMP% directories by unexpected users
- Script execution failures followed by successful executions after cache manipulation
- Evidence of symbolic link attacks targeting the Kotlin script cache directory
Detection Strategies
- Monitor file system activity in shared temporary directories for suspicious cache file creation or modification
- Implement file integrity monitoring (FIM) on known Kotlin script cache locations
- Deploy endpoint detection rules to alert on privilege escalation patterns involving Kotlin processes
- Review system logs for unusual Kotlin script execution patterns across different user contexts
Monitoring Recommendations
- Enable auditing on temporary directory write operations for early detection of cache poisoning attempts
- Configure SentinelOne to monitor for suspicious process lineage involving Kotlin script execution
- Establish baseline behavior for Kotlin development environments and alert on deviations
- Monitor for symlink creation in temp directories that may indicate exploitation attempts
How to Mitigate CVE-2020-15824
Immediate Actions Required
- Upgrade JetBrains Kotlin to version 1.4.0 or later immediately
- Audit systems for any evidence of compromise in shared temporary directories
- Review Oracle Banking Extensibility Workbench and Oracle Communications Cloud Native Core Policy deployments for bundled vulnerable Kotlin versions
- Clear existing Kotlin script cache directories on affected systems after upgrading
Patch Information
JetBrains has addressed this vulnerability in Kotlin version 1.4.0. The fix ensures that script cache files are stored in user-specific directories with appropriate permissions, preventing cross-user cache manipulation. Organizations should refer to the JetBrains Q2 2020 Security Bulletin for official guidance.
For Oracle products, refer to the Oracle October 2021 CPU and Oracle January 2022 CPU for patch details related to affected Oracle products bundling Kotlin.
Workarounds
- Configure a dedicated user-specific directory for Kotlin script caching by setting the appropriate environment variables or system properties
- Restrict permissions on the system temporary directory to prevent unauthorized write access where feasible
- Implement temporary directory isolation using containerization or namespace separation for build environments
- Consider disabling script caching entirely in high-security environments until patches can be applied
# Configuration example: Set restrictive permissions on temp cache directory
mkdir -p /home/$USER/.kotlin-cache
chmod 700 /home/$USER/.kotlin-cache
export KOTLIN_MAIN_KTS_COMPILED_SCRIPTS_CACHE_DIR=/home/$USER/.kotlin-cache
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

