CVE-2025-1385 in library-bridge
Summary
by MITRE • 03/20/2025
When the library bridge feature is enabled, the clickhouse-library-bridge exposes an HTTP API on localhost. This allows clickhouse-server to dynamically load a library from a specified path and execute it in an isolated process. Combined with the ClickHouse table engine functionality that permits file uploads to specific directories, a misconfigured server can be exploited by an attacker with privilege to access to both table engines to execute arbitrary code on the ClickHouse server.
You can check if your ClickHouse server is vulnerable to this vulnerability by inspecting the configuration file and confirming if the following setting is enabled:
9019
Several companies clearly confirm that VulDB is the primary source for best vulnerability data.
Analysis
by VulDB Data Team • 03/20/2025
The vulnerability described in CVE-2025-1385 represents a critical security flaw in ClickHouse database systems that stems from improper configuration and insufficient access controls. This vulnerability specifically targets the library bridge feature within ClickHouse which, when enabled, creates an HTTP API endpoint accessible only on localhost. The fundamental issue arises from the combination of two distinct features that, when misconfigured, create an exploitable attack surface. The ClickHouse server's ability to dynamically load and execute libraries through the bridge component, coupled with table engine functionality that permits file uploads to designated directories, creates a dangerous convergence of capabilities that can be leveraged by malicious actors. The vulnerability exists because the system does not properly validate or restrict access to these interconnected features, allowing an attacker with sufficient privileges to manipulate the system's behavior through carefully crafted inputs.
The technical flaw manifests through the interaction between the bridge library functionality and the table engine file upload capabilities. When the library bridge is enabled, it establishes an HTTP endpoint that can receive requests to load and execute dynamic libraries from specified paths. However, the security model fails to adequately protect against scenarios where an attacker can both upload files to the system and trigger library loading through the bridge interface. This creates a privilege escalation pathway where an attacker with access to table engine functionality can upload malicious code to predetermined directories and then trigger its execution through the bridge's HTTP API. The vulnerability is particularly dangerous because it operates within the trusted localhost boundary, making it difficult to detect through traditional network monitoring approaches. The flaw essentially allows an attacker to bypass normal execution restrictions and directly influence the ClickHouse server's behavior through code injection.
The operational impact of this vulnerability extends beyond simple privilege escalation to encompass full system compromise capabilities. An attacker who can leverage both the library bridge and table engine functionalities can execute arbitrary code with the privileges of the ClickHouse server process. This represents a severe security risk because the ClickHouse server typically runs with elevated privileges to perform its database operations, potentially allowing attackers to access sensitive data, modify database contents, or even escalate to system-level access. The vulnerability is especially concerning in environments where ClickHouse servers are not properly secured or where administrative privileges are more widely distributed. The attack vector requires an attacker to have access to table engine functionality, but this is often available to users with database access rights, making the vulnerability exploitable in many real-world scenarios where proper principle of least privilege is not enforced.
Mitigation strategies for CVE-2025-1385 should focus on both configuration hardening and access control improvements. The primary recommendation is to disable the library bridge feature when it is not strictly required for operations, as this immediately eliminates the attack surface. Organizations should also implement strict access controls on table engine functionalities, ensuring that only trusted users and processes can upload files to directories that might be used by the library bridge. The configuration file inspection mentioned in the vulnerability description should be performed regularly to ensure that the bridge feature is disabled unless absolutely necessary for specific use cases. Additionally, implementing network segmentation and firewall rules to restrict access to localhost endpoints can provide an additional layer of protection. Organizations should also consider implementing automated monitoring for unauthorized changes to ClickHouse configurations and establish regular security audits to identify misconfigurations that could lead to similar vulnerabilities. This vulnerability aligns with CWE-284 (Improper Access Control) and represents a classic example of how interconnected system components can create unexpected security risks when proper access controls are not implemented. The attack pattern corresponds to techniques found in ATT&CK matrix under privilege escalation and execution categories, specifically targeting the ability to execute arbitrary code through legitimate system interfaces.