CVE-2024-6873

8.1 HIGH

📋 TL;DR

CVE-2024-6873 is a heap-based buffer overflow vulnerability in ClickHouse's native interface that allows unauthenticated attackers to crash the server or redirect execution flow within a limited 256-byte memory range. All ClickHouse users with exposed native interfaces are affected. While remote code execution hasn't been demonstrated, the vulnerability enables denial of service and potential information disclosure.

💻 Affected Systems

Products:
  • ClickHouse
Versions: All versions before the fix in commit 64024
Operating Systems: All platforms running ClickHouse
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerable when ClickHouse native interface (default port 9000) is accessible to attackers.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Server crash leading to denial of service, potential information disclosure from memory contents, or limited code execution within the 256-byte memory range.

🟠

Likely Case

Server crash and denial of service through crafted requests, disrupting database operations.

🟢

If Mitigated

No impact if the native interface is not exposed to untrusted networks or if the patch is applied.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting specific requests but no authentication. No known RCE exploits exist.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in commit 64024, included in all currently supported versions

Vendor Advisory: https://github.com/ClickHouse/ClickHouse/security/advisories/GHSA-432f-r822-j66f

Restart Required: Yes

Instructions:

1. Upgrade to the latest supported ClickHouse version. 2. Apply the specific fix from commit 64024 if using a forked version. 3. Restart the ClickHouse service.

🔧 Temporary Workarounds

Network Segmentation

linux

Restrict access to ClickHouse native interface (port 9000) to trusted networks only

iptables -A INPUT -p tcp --dport 9000 -s TRUSTED_NETWORK -j ACCEPT
iptables -A INPUT -p tcp --dport 9000 -j DROP

Disable Native Interface

all

Configure ClickHouse to disable the vulnerable native interface if not required

Modify config.xml: <native_port>0</native_port> or remove native protocol configuration

🧯 If You Can't Patch

  • Implement strict network access controls to limit exposure of port 9000
  • Deploy web application firewall (WAF) rules to detect and block suspicious ClickHouse native protocol requests

🔍 How to Verify

Check if Vulnerable:

Check ClickHouse version and compare with patched versions. Test with vulnerability scanner if available.

Check Version:

clickhouse-client --query 'SELECT version()'

Verify Fix Applied:

Verify ClickHouse version includes commit 64024 or later. Test that specially crafted requests no longer cause crashes.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected server crashes
  • Error logs containing memory access violations
  • Unusual connection patterns to port 9000

Network Indicators:

  • Malformed packets to port 9000
  • Repeated connection attempts to native interface
  • Traffic patterns matching known exploit signatures

SIEM Query:

source="clickhouse.log" AND ("segmentation fault" OR "memory violation" OR "buffer overflow")

🔗 References

📤 Share & Export