提交 #767236: OpenBMB XAgent 1.0.0 Path Traversal (CWE-22)信息

标题OpenBMB XAgent 1.0.0 Path Traversal (CWE-22)
描述A Path Traversal vulnerability exists in the `workspace` router method in `XAgentServer/application/routers/workspace.py` of XAgent. The application fails to sanitize the `file_name` parameter received from user-submitted form data before passing it to `os.path.join()`. The resulting path is used directly to open and return file contents, with no call to `os.path.basename()`, no stripping of `../`, and no `os.path.realpath()` prefix check. # Vulnerable Code File: XAgentServer/application/routers/workspace.py (Lines 70-139) Method: /workspace/file endpoint Why: The `file_name` parameter (line 74) is received directly from form data and passed unsanitized to `os.path.join(file_path, file_name)` across all suffix branches (lines 98, 108, 113, 118, 122, 132, 136), allowing traversal to arbitrary paths outside the intended workspace directory. # Reproduction 1. Clone and start the stack: git clone https://github.com/OpenBMB/XAgent.git && cd XAgent && docker compose up -d 2. Login with hardcoded default credentials: POST /user/login with email=Guest, token=xagent 3. Create an interaction: POST /conv/init_conv_env with user_id=guest, token=xagent 4. Trigger path traversal: POST /workspace/file with user_id=guest, token=xagent, interaction_id=<ID>, file_name=../../../../../../../etc/passwd 5. The full /etc/passwd contents are returned in the HTTP response body. # Impact - Arbitrary File Read on the main XAgentServer container filesystem - Exfiltration of database credentials (MySQL root:xagent, Redis password from envs.py) - Exfiltration of all users' interaction data and workspace files - Exfiltration of application source code, JWT/session secrets, API keys - System files like /etc/shadow accessible (container runs as root by default) - Default credentials (guest/xagent) ship enabled by default, making this exploitable on any fresh deployment with zero credential theft required.
来源⚠️ https://github.com/OpenBMB/XAgent/issues/420
用户
 Eric-x (UID 94869)
提交2026-02-25 09時58分 (7 月前)
管理2026-03-11 13時27分 (14 days later)
状态已接受
VulDB条目350384 [OpenBMB XAgent 1.0.0 workspace.py workspace file_name 目录遍历]
积分20

Want to stay up to date on a daily basis?

Enable the mail alert feature now!