You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both files and /open_folder call get_work_dir(task_id); however, get_work_dir simply performs os.path.join("project", "work_dir", task_id) followed by os.path.exists(), unlike /messages which first checks ensure_safe_task_id. This means that when passing values like ../../.., the path might be resolved to a directory outside the task directory.
Caution
/files can be used to enumerate a list of files in any existing directory; /open_folder might even attempt to open the path on the server. It is a potential entry point for path traversal.
Both
filesand/open_foldercallget_work_dir(task_id); however,get_work_dirsimply performsos.path.join("project", "work_dir", task_id)followed byos.path.exists(), unlike/messageswhich first checksensure_safe_task_id. This means that when passing values like../../.., the path might be resolved to a directory outside the task directory.Caution
/filescan be used to enumerate a list of files in any existing directory;/open_foldermight even attempt to open the path on the server. It is a potential entry point for path traversal.