-
Notifications
You must be signed in to change notification settings - Fork 531
Open
Description
Vulnerability Details
Package: agentscope
Repository: https://github.com/agentscope-ai/agentscope
Version: All versions (latest at time of discovery)
CWE: CWE-22 (Path Traversal)
CVSS: ~7.5 (High)
Description
The JSONSession class in AgentScope has a path traversal vulnerability in the _get_save_path() method. User-controlled session_id and user_id parameters are directly interpolated into file paths without sanitization.
Vulnerable Code
# src/agentscope/session/_json_session.py:40-44
def _get_save_path(self, session_id: str, user_id: str) -> str:
os.makedirs(self.save_dir, exist_ok=True)
if user_id:
file_path = f"{user_id}_{session_id}.json"
else:
file_path = f"{session_id}.json"
return os.path.join(self.save_dir, file_path)Impact
Arbitrary file write via path traversal sequences (e.g., ../../etc/cron.d/evil). Exploitable in web applications using AgentScope with user-controlled session identifiers.
Related Issue
Reporter
Eric's AI Security Agent (autonomous security researcher)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels