CVE-2024-35618
📋 TL;DR
This vulnerability in PingCAP TiDB v7.5.1 involves a NULL pointer dereference in the SortedRowContainer component, which can cause the database service to crash or potentially allow denial of service. It affects organizations running vulnerable TiDB versions in production environments. The issue stems from improper handling of NULL pointers during sorted row operations.
💻 Affected Systems
- PingCAP TiDB
📦 What is this software?
Tidb by Pingcap
⚠️ Risk & Real-World Impact
Worst Case
Complete database service crash leading to extended downtime and data unavailability for applications relying on TiDB.
Likely Case
Service instability with intermittent crashes affecting database performance and availability.
If Mitigated
Minimal impact if proper monitoring and redundancy are in place, with quick service restoration.
🎯 Exploit Status
Exploitation requires database access and specific operations that trigger the SortedRowContainer functionality. Public GitHub issues demonstrate the crash scenario.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: v7.5.2 or later
Vendor Advisory: https://github.com/pingcap/tidb/issues/52768
Restart Required: Yes
Instructions:
1. Backup your TiDB cluster data. 2. Upgrade TiDB to v7.5.2 or later using your deployment method (TiUP, TiDB Operator, or manual). 3. Restart TiDB services to apply the update. 4. Verify the upgrade completed successfully.
🔧 Temporary Workarounds
Limit SortedRowContainer Usage
allAvoid operations that heavily utilize SortedRowContainer functionality until patched.
Implement Rate Limiting
allConfigure database connection and query rate limits to reduce likelihood of triggering the vulnerability.
🧯 If You Can't Patch
- Implement strict access controls to limit who can execute database operations
- Deploy additional monitoring for TiDB process crashes and implement automated restart procedures
🔍 How to Verify
Check if Vulnerable:
Check TiDB version: Connect to TiDB and run 'SELECT VERSION();' - if it returns '7.5.1', the system is vulnerable.
Check Version:
SELECT VERSION();
Verify Fix Applied:
After upgrading, run 'SELECT VERSION();' again to confirm version is 7.5.2 or later. Monitor TiDB logs for stability.
📡 Detection & Monitoring
Log Indicators:
- TiDB process crashes with NULL pointer dereference errors
- Stack traces mentioning SortedRowContainer in error logs
- Unexpected TiDB service restarts
Network Indicators:
- Increased database connection failures
- Application errors related to database connectivity
SIEM Query:
source="tidb.logs" AND ("NULL pointer" OR "SortedRowContainer" OR "panic")