CVE-2024-6583
Executive Summary
CVE-2024-6583 is a path traversal vulnerability in the latest version of stangirard/quivr, an open-source AI assistant platform. The flaw allows an attacker to upload files to arbitrary paths within an S3 bucket by manipulating the file path in the upload request. With a CVSS score of 4.3 (Medium), the vulnerability primarily impacts data integrity and could lead to unauthorized file overwrites or storage of malicious content. No public exploit code or patch is currently available, and the EPSS score is 0.0%, indicating low exploitation likelihood at this time. However, the lack of a patch and the potential for S3 bucket compromise warrant immediate attention.
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
This vulnerability affects the quivr application, which is distributed via GitHub and potentially as a Docker image. Organizations using quivr should verify the integrity of their deployment and monitor for any unauthorized file uploads. Since no patch exists, supply chain risk is elevated, and users should consider isolating quivr instances until a fix is released.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
- Base Score: 4.3 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: Low
- Availability Impact: None
The vulnerability allows an unauthenticated attacker to upload files to arbitrary S3 paths, potentially overwriting critical data or injecting malicious files. While confidentiality and availability are not directly impacted, integrity loss could lead to further compromise.
Deep Dive & Mechanics
The vulnerability resides in the file upload functionality of quivr, which uses an S3 bucket for storage. The application fails to sanitize or validate the file path provided by the user during upload. By crafting a request with path traversal sequences (e.g., ../), an attacker can escape the intended upload directory and write files to any location within the S3 bucket.
Root Cause:
- Insufficient input validation on the
file_pathparameter. - Lack of path canonicalization before constructing the S3 object key.
- No restriction on directory traversal characters.
Attack Flow:
- Attacker identifies the upload endpoint (e.g.,
/api/upload). - Attacker sends a POST request with a manipulated
file_pathparameter containing../sequences. - The application constructs an S3 object key using the unsanitized path.
- The file is uploaded to an arbitrary S3 location, potentially overwriting existing objects or placing malicious content.
Impact:
- Overwrite of configuration files, static assets, or user data.
- Upload of web shells or malware if the S3 bucket is used for serving content.
- Potential privilege escalation if the bucket contains sensitive data.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code pattern is inferred from typical path traversal issues.
Vulnerable Code (Python-like pseudocode):
def upload_file(file, file_path):
s3_client.put_object(Bucket='quivr-bucket', Key=file_path, Body=file)
Patched Code (Recommended):
import os
def upload_file(file, file_path):
# Sanitize the file path
safe_path = os.path.normpath(file_path).lstrip('/')
if '..' in safe_path or safe_path.startswith('/'):
raise ValueError("Invalid file path")
s3_client.put_object(Bucket='quivr-bucket', Key=safe_path, Body=file)
The patched version normalizes the path and rejects any traversal attempts.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to a quivr instance with file upload functionality.
- Knowledge of the S3 bucket name (may be discoverable via error messages or source code).
Exploitation Steps:
- Identify the upload endpoint (e.g.,
/api/upload). - Craft a malicious request using
curl:curl -X POST -F "file=@malicious.txt" -F "file_path=../../config/override.txt" http://target.com/api/upload - Verify the file was uploaded to the target path by accessing the S3 bucket directly or via the application.
Expected Outcome:
- File written to
config/override.txtin the S3 bucket, potentially overwriting application configuration.
Blue Team
Detection & Response:
- Monitor S3 bucket logs for
PutObjectevents with unexpected object keys containing..or absolute paths. - Implement input validation on the upload endpoint to reject path traversal patterns.
- Use AWS S3 bucket policies to restrict write access to specific prefixes.
Lab Setup for Testing:
- Deploy a local instance of quivr using Docker.
- Configure an S3-compatible storage (e.g., MinIO) for testing.
- Simulate the attack using the curl command above and observe logs.
Indicators of Compromise (IOCs)
Network:
- HTTP POST requests to
/api/uploadwithfile_pathparameter containing../or absolute paths. - Unusual S3
PutObjectAPI calls to paths outside the expected upload directory.
- HTTP POST requests to
File System (S3):
- Files appearing in unexpected S3 prefixes (e.g.,
config/,static/,etc/). - New files with suspicious names or content (e.g., web shells, configuration overrides).
- Files appearing in unexpected S3 prefixes (e.g.,
Logs:
- Application logs showing
file_pathvalues with traversal sequences. - AWS CloudTrail events for
PutObjectwith anomalous object keys.
- Application logs showing
Detection Engineering
YARA Rule
rule CVE_2024_6583_PathTraversal {
meta:
description = "Detects path traversal attempts in quivr upload requests"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-6583"
strings:
$traversal1 = "../"
$traversal2 = "..\\"
$traversal3 = "/.."
$traversal4 = "\\.."
condition:
any of them
}
Sigma Rule
title: CVE-2024-6583 Path Traversal in quivr Upload
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects path traversal attempts in quivr file upload requests
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains:
- '../'
- '..\\'
- '/..'
- '\\..'
condition: selection
falsepositives:
- Legitimate use of dots in filenames (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-6583 Path Traversal in quivr Upload"; flow:to_server; content:"POST"; http_method; content:"/api/upload"; http_uri; content:"file_path"; nocase; pcre:"/(\.\.\/|\.\.\\)/"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable file upload functionality in quivr until a patch is available.
- Implement a Web Application Firewall (WAF) rule to block path traversal patterns in upload requests.
- Restrict S3 bucket write permissions to a specific prefix using bucket policies.
Long-Term Fix:
- Apply input validation and sanitization on the
file_pathparameter. - Use a whitelist of allowed directories for uploads.
- Regularly update quivr to the latest version once a patch is released.
Monitoring:
- Enable S3 access logging and monitor for anomalous
PutObjectevents. - Set up alerts for path traversal patterns in application logs.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.