CVE-2019-16535 in ClickHouseinfo

Summary

by MITRE

In all versions of ClickHouse before 19.14, an OOB read, OOB write and integer underflow in decompression algorithms can be used to achieve RCE or DoS via native protocol.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 06/25/2025

The vulnerability identified as CVE-2019-16535 represents a critical security flaw affecting all versions of the ClickHouse database management system prior to version 19.14. This vulnerability resides within the decompression algorithms used by the system's native protocol implementation, creating multiple attack vectors that can be exploited by remote adversaries. The flaw manifests through out-of-bounds read operations, out-of-bounds write operations, and integer underflow conditions that occur during the decompression process of data received through the native network protocol.

The technical implementation of this vulnerability stems from insufficient input validation and boundary checking within the decompression routines that handle data received from clients over the native protocol. When maliciously crafted compressed data is processed by the vulnerable ClickHouse instances, the decompression algorithms fail to properly validate array indices and buffer boundaries, leading to memory corruption conditions. The integer underflow specifically occurs when calculating buffer sizes or iteration counts during decompression, creating scenarios where subsequent memory access operations can traverse invalid memory regions. These memory corruption conditions are particularly dangerous because they can be manipulated to overwrite critical memory locations, potentially allowing attackers to execute arbitrary code on the target system.

The operational impact of CVE-2019-16535 extends beyond simple denial-of-service conditions to encompass full remote code execution capabilities. Attackers can leverage this vulnerability to gain complete control over affected ClickHouse servers, potentially leading to data exfiltration, system compromise, and lateral movement within network environments. The native protocol used by ClickHouse is commonly exposed to external networks for database operations, making these systems particularly vulnerable to exploitation. Organizations running older versions of ClickHouse without proper network segmentation or access controls face significant risk, as the vulnerability can be exploited remotely without authentication requirements.

The vulnerability aligns with CWE-129, which addresses improper validation of array index values, and CWE-131, which covers improper handling of length parameters in binary protocols. From an adversarial perspective, this vulnerability maps to multiple ATT&CK tactics including TA0002 (Execution) and TA0005 (Defense Evasion) as attackers can execute code and potentially evade detection mechanisms. The attack surface is particularly concerning given ClickHouse's widespread adoption in data analytics and monitoring environments where database servers often contain sensitive operational data. Organizations should prioritize immediate patching to version 19.14 or later, implement network segmentation to limit exposure of the native protocol port, and consider monitoring for suspicious decompression activities in their network traffic analysis systems.

Mitigation strategies should include immediate deployment of the patched ClickHouse version 19.14 or later, which addresses the underlying decompression algorithm flaws through enhanced boundary checking and input validation. Network administrators should implement firewall rules to restrict access to the native protocol port, typically 9000, limiting connections to trusted sources only. Additional defensive measures include implementing intrusion detection systems with signature detection for known exploitation patterns, conducting thorough vulnerability assessments of all ClickHouse instances, and establishing monitoring procedures to detect anomalous decompression activity. Organizations should also consider implementing application-level controls such as connection limits, rate limiting, and input sanitization to reduce the attack surface further. The vulnerability demonstrates the critical importance of proper input validation in cryptographic and compression algorithms, emphasizing that even well-established protocols can contain dangerous edge cases that require careful attention to memory safety principles.

Reservation

09/19/2019

Moderation

accepted

CPE

ready

EPSS

0.01695

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!