IPBUF安全漏洞报告
English
CVE-2025-11489 CVSS 4.5 中危

CVE-2025-11489 DesktopCommanderMCP符号链接跟随漏洞

披露日期: 2025-10-08

漏洞信息

漏洞编号
CVE-2025-11489
漏洞类型
符号链接跟随(Symlink Following)
CVSS评分
4.5 中危
攻击向量
本地 (AV:L)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
wonderwhy-er DesktopCommanderMCP

相关标签

CVE-2025-11489符号链接跟随Symlink Following路径遍历DesktopCommanderMCPMCP本地提权文件系统安全中危漏洞CWE-59

漏洞概述

CVE-2025-11489是wonderwhy-er DesktopCommanderMCP中存在的一个安全漏洞,影响版本至0.2.13。该漏洞位于src/tools/filesystem.ts文件的isPathAllowed函数中,由于该函数未能正确处理符号链接(symlink),攻击者可以通过创建指向受限目录的符号链接来绕过路径访问限制,从而实现对未授权文件或目录的读写操作。

该漏洞的攻击向量为本地攻击(AV:L),攻击者需要具备低权限(PR:L),无需用户交互(UI:N)。根据CVSS 3.1向量评分,该漏洞的综合评分为4.5分,属于中危级别。漏洞的机密性影响为高(C:H),完整性影响为低(I:L),可用性影响为低(A:L)。攻击复杂度被评定为高(AC:H),利用难度较大。

值得注意的是,DesktopCommanderMCP的维护者对该漏洞的态度值得关注。供应商表示其限制功能是为LLM设计的辅助引导措施(guardrails),而非硬化的安全边界。对于安全要求较高的用户,建议在Docker环境中使用Desktop Commander以提供真正的隔离。该漏洞仅影响不再受维护者支持的产品版本,因此官方可能不会发布修复补丁。

此漏洞已在GitHub上公开披露(issue #219),存在被利用的可能性,尽管利用难度较高。安全研究人员和管理员应充分了解该漏洞的风险,并采取适当的缓解措施。

技术细节

DesktopCommanderMCP的isPathAllowed函数负责验证文件操作请求的路径是否在允许的目录范围内。然而,该函数在实现路径检查时未能充分考虑符号链接的情况。

漏洞的根本原因在于:当用户或进程请求访问一个路径时,isPathAllowed函数仅检查路径字符串本身是否在允许列表中,而没有解析符号链接来获取其实际指向的目标路径。攻击者可以创建一个指向受限目录(如系统敏感目录或其他用户目录)的符号链接,然后通过该符号链接发起文件操作请求。由于符号链接本身的路径可能位于允许的目录内,isPathAllowed函数会错误地允许该操作,从而导致对受限目录的未授权访问。

利用方式如下:
1. 攻击者在允许的目录中创建一个符号链接,指向目标受限目录或文件
2. 通过DesktopCommanderMCP的文件操作接口(如read_file、write_file等)通过该符号链接发起请求
3. isPathAllowed函数检查符号链接路径(在允许目录内),判定为合法
4. 实际的文件操作作用于符号链接指向的目标(受限目录/文件),导致路径限制被绕过

该漏洞的攻击复杂度较高,因为攻击者需要能够在本地创建符号链接,且需要对目标系统的目录结构有一定了解。此外,攻击需要低权限即可执行,这增加了在多用户环境中的风险。

攻击链分析

STEP 1
步骤1:环境准备
攻击者获取对系统的本地低权限访问权限,确认DesktopCommanderMCP已安装且配置了路径访问限制(allowedDirectories)。
STEP 2
步骤2:创建恶意符号链接
攻击者在DesktopCommanderMCP允许的目录内创建一个符号链接,指向受限目录中的敏感文件或目录(如系统配置文件、其他用户文件等)。
STEP 3
步骤3:发起文件操作请求
通过DesktopCommanderMCP的文件操作工具(如read_file、write_file、list_directory等)通过符号链接路径发起操作请求。
STEP 4
步骤4:绕过路径限制检查
isPathAllowed函数检查符号链接的路径字符串,发现其在允许目录列表中,因此判定请求合法并放行。
STEP 5
步骤5:完成未授权访问
操作系统解析符号链接,实际的文件操作作用于受限目标,攻击者成功读取、修改或列出了受限目录中的敏感内容。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# CVE-2025-11489 - DesktopCommanderMCP Symlink Following PoC # This PoC demonstrates how to bypass path restrictions via symlink import os import subprocess # Step 1: Create a symlink in an allowed directory pointing to a restricted target allowed_dir = "/tmp/allowed" # Directory permitted by isPathAllowed restricted_target = "/etc/shadow" # Restricted file we want to access symlink_path = os.path.join(allowed_dir, "innocent_link") # Create the allowed directory if it doesn't exist os.makedirs(allowed_dir, exist_ok=True) # Create a symbolic link if os.path.exists(symlink_path): os.remove(symlink_path) os.symlink(restricted_target, symlink_path) print(f"[+] Created symlink: {symlink_path} -> {restricted_target}") # Step 2: Use DesktopCommanderMCP's file operation via the symlink # When DesktopCommanderMCP processes a read_file request through the symlink, # isPathAllowed checks the symlink path (in allowed dir) and approves it. # The actual file read follows the symlink to the restricted target. # Simulate the MCP tool call (pseudo-code): # mcp_client.call_tool("read_file", {"path": symlink_path}) # isPathAllowed(symlink_path) -> True (path is in allowed_dir) # Actual read follows symlink -> reads /etc/shadow content print(f"[+] Requesting file read through symlink: {symlink_path}") print("[+] isPathAllowed will approve the symlink path") print("[+] Actual file access follows symlink to restricted target") # Step 3: Demonstrate the bypass try: with open(symlink_path, 'r') as f: content = f.read() print(f"[+] Successfully read restricted file content (first 100 chars): {content[:100]}") except PermissionError: print("[-] Direct read blocked, but MCP tool call would succeed via symlink bypass") # Step 4: Cleanup os.remove(symlink_path) print("[+] Cleanup complete")

影响范围

wonderwhy-er DesktopCommanderMCP <= 0.2.13

防御指南

临时缓解措施
由于该漏洞仅影响不再受维护者支持的产品版本,官方可能不会发布修复补丁。建议采取以下临时缓解措施:1)在Docker容器中运行DesktopCommanderMCP,利用容器隔离限制文件系统的访问范围;2)在操作系统层面配置强制访问控制(MAC)策略,如SELinux或AppArmor,限制DesktopCommanderMCP进程的文件系统访问权限;3)如果可能,升级到维护者后续可能发布的修复版本;4)限制能够访问DesktopCommanderMCP的用户权限,减少低权限用户利用该漏洞的风险;5)定期审计系统中的符号链接,及时发现和清理可疑链接。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表