Path Traversal in modelscope/agentscope
Description
A path traversal vulnerability exists in modelscope/agentscope version v.0.0.4. The API endpoint /api/file does not properly sanitize the path parameter, allowing an attacker to read arbitrary files on the server.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Path traversal in AgentScope v0.0.4's /api/file endpoint allows unauthenticated attackers to read arbitrary server files via unsanitized path parameter.
Vulnerability
Overview
CVE-2024-8438 describes a path traversal vulnerability in AgentScope version 0.0.4, specifically in the /api/file API endpoint. The endpoint fails to sanitize the path parameter, allowing directory traversal sequences such as ../ to escape the intended directory [2][3]. The vulnerable code resides in src/agentscope/studio/_app.py at line 578, where the user-supplied path is passed directly to file read operations without validation [3].
Exploitation
An attacker can exploit this vulnerability by sending a crafted HTTP GET request to the /api/file endpoint with a malicious path parameter containing traversal sequences. No authentication is required, as the endpoint is publicly accessible in the default configuration [2][4]. For example, requesting /api/file?path=../../etc/passwd would retrieve the server's password file.
Impact
Successful exploitation allows an attacker to read arbitrary files on the server, including configuration files, credentials, source code, and other sensitive data. This information disclosure can lead to further compromise of the system and its data [2].
Mitigation
The vulnerability is present in AgentScope version 0.0.4. Users should upgrade to a patched version as soon as it becomes available. As a workaround, administrators can implement input validation to reject path traversal sequences or restrict access to the /api/file endpoint via a reverse proxy [1].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
agentscopePyPI | <= 0.0.4 | — |
Affected products
3- Range: =0.0.4
- modelscope/modelscope/agentscopev5Range: unspecified
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4News mentions
0No linked articles in our index yet.