Severity: MEDIUM
Description: An issue was discovered in H2 1.4.197. Insecure handling of permissions in the backup function allows attackers to read sensitive files (outside of their permissions) via a symlink to a fake database file.
CVSS Score: N/A
D
No data available.
1. Risk Assessment
The vulnerability, CVE-2018-14335, resides in H2 database version 1.4.197 and stems from insecure handling of permissions during the backup function. This allows an attacker, with low privileges, to read sensitive files outside of their normal permissions by leveraging a symlink to a fake database file. The vulnerability's impact is primarily on confidentiality, as sensitive data can be exposed. The likelihood of exploitation is moderate, as it requires the attacker to have some level of access to the system and the ability to create a symlink. The ease of exploitation is also moderate, with available exploits demonstrating relatively straightforward execution. The CVSS v3.1 score is 6.5 (Medium severity). The EPSS score of 0.084520000 indicates a relatively low, but non-negligible, probability of exploitation in the wild. Business impact could include data breaches, compromised credentials, and potential exposure of proprietary information.
2. Potential Attack Scenarios
An attacker gains low-level access to a server running H2 database 1.4.197. They create a symbolic link named 'fake_db.h2.db' pointing to a sensitive file, such as /etc/passwd or a configuration file containing database credentials. When a database backup is performed using the vulnerable H2 version, the backup function will follow the symlink and include the contents of the sensitive file in the backup. The attacker can then retrieve the backup and extract the sensitive data from the included file, effectively reading it with elevated permissions. This could lead to credential theft and further compromise of the system.
3. Mitigation Recommendations
The primary mitigation is to upgrade to a newer version of H2 database that addresses this vulnerability. Versions after 1.4.197 should resolve the issue. If upgrading immediately isn’t feasible, restrict access to the database backup directory to only necessary users and groups. Implement strict symlink validation to ensure only expected files are included in the backup process. Consider using file system permissions to limit write access to the backup directory. Red Hat Security Advisory RHSA-2020:0727 provides specific guidance for Red Hat deployments. Refer to the H2 database documentation for upgrade instructions: http://www.h2database.com/html/main.htm. Exploit-DB provides a proof-of-concept exploit that can be used to test the vulnerability: https://www.exploit-db.com/exploits/45105/.
4. Executive Summary
CVE-2018-14335 is a vulnerability in the H2 database that allows attackers to read sensitive files outside of their normal permissions during the backup process. This can lead to data breaches and compromise of system credentials. The vulnerability is moderately likely to be exploited, and the impact on confidentiality could be significant. We recommend upgrading to the latest version of H2 database as soon as possible to mitigate the risk. If an immediate upgrade is not possible, restrict access to the backup directory and validate symlinks. Addressing this vulnerability is important to protect sensitive data and maintain the integrity of our systems. The impact could range from minor data exposure to a full-scale compromise depending on the sensitivity of the files accessible through the symlink.