CVE-2020-29050
📋 TL;DR
This CVE describes a directory traversal vulnerability in SphinxSearch that allows attackers to read arbitrary files on the server. When combined with CVE-2019-14511, the mysql client can be used with CALL SNIPPETS and load_file operations to access files outside the intended directory (e.g., /etc/passwd). This affects SphinxSearch installations through version 3.1.1.
💻 Affected Systems
- SphinxSearch
- Sphinx Technologies Sphinx
📦 What is this software?
Sphinx by Sphinxsearch
⚠️ Risk & Real-World Impact
Worst Case
Attackers can read sensitive system files (passwords, configuration files, SSH keys) leading to complete system compromise and lateral movement.
Likely Case
Unauthorized file disclosure of configuration files, potentially exposing credentials and system information.
If Mitigated
Limited impact with proper network segmentation and file permission restrictions.
🎯 Exploit Status
Exploitation is straightforward using mysql client commands with CALL SNIPPETS and load_file operations.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Versions after 3.1.1
Vendor Advisory: https://security-tracker.debian.org/tracker/CVE-2020-29050
Restart Required: Yes
Instructions:
1. Upgrade SphinxSearch to version after 3.1.1. 2. Restart the SphinxSearch service. 3. Verify the fix by testing the vulnerability.
🔧 Temporary Workarounds
Restrict mysql client access
linuxLimit network access to SphinxSearch mysql interface to trusted IPs only
iptables -A INPUT -p tcp --dport 9306 -s trusted_ip -j ACCEPT
iptables -A INPUT -p tcp --dport 9306 -j DROP
File system restrictions
linuxRun SphinxSearch with minimal file system permissions using chroot or containerization
chroot /var/sphinx /usr/bin/searchd --config /etc/sphinx/sphinx.conf
🧯 If You Can't Patch
- Implement strict network segmentation to isolate SphinxSearch instances
- Apply file system permissions to restrict SphinxSearch process from accessing sensitive directories
🔍 How to Verify
Check if Vulnerable:
Check SphinxSearch version: searchd --version. If version is 3.1.1 or earlier, system is vulnerable.
Check Version:
searchd --version
Verify Fix Applied:
After patching, attempt to exploit using mysql client with CALL SNIPPETS on a known sensitive file path.
📡 Detection & Monitoring
Log Indicators:
- Unusual mysql client connections to port 9306
- CALL SNIPPETS operations with file paths
- Failed file access attempts in system logs
Network Indicators:
- Unexpected traffic to SphinxSearch mysql port (9306) from untrusted sources
- Patterns of file path traversal in network packets
SIEM Query:
source="sphinx.log" AND ("CALL SNIPPETS" OR "load_file") AND (".." OR "/etc" OR "/root")
🔗 References
- https://blog.wirhabenstil.de/2019/08/19/sphinxsearch-0-0-0-09306-cve-2019-14511/
- https://lists.debian.org/debian-lts-announce/2022/01/msg00009.html
- https://security-tracker.debian.org/tracker/CVE-2020-29050
- https://blog.wirhabenstil.de/2019/08/19/sphinxsearch-0-0-0-09306-cve-2019-14511/
- https://lists.debian.org/debian-lts-announce/2022/01/msg00009.html
- https://security-tracker.debian.org/tracker/CVE-2020-29050