针对影响 Gotenberg 的 CVE-2026-42589 的本地复现实验室及 nuclei 模板草稿。
CVE-2026-42589 是 Gotenberg 中一个未经认证的远程代码执行问题,由元数据键中的换行符注入引起,具体在:
POST /forms/pdfengines/metadata/write
受影响的 Gotenberg 将用户控制的元数据键转发给 ExifTool,且未拒绝控制字符。一个包含 JSON 转义换行符的元数据键可能被拆分为额外的 ExifTool 参数。
本实验室用于验证:
gotenberg/gotenberg:8.29.1 上的脆弱行为gotenberg/gotenberg:8.31.0 上的修复行为nuclei 模板仅使用非破坏性的 sleep 6 延迟检查。
docker-compose.ymldocker-compose.latest.ymlCVE-2026-42589.yamlmanual_verify.pysample.pdfREADME.md启动 Gotenberg 8.29.1:
docker compose down -v
docker compose up -d
docker compose logs --tail=100 gotenberg
检查版本:
curl -s http://127.0.0.1:3000/version
手动原始 multipart 延迟检查:
python3 manual_verify.py http://127.0.0.1:3000
预期的脆弱信号:
HTTP/1.1 500 Internal Server Error
TOTAL_TIME=6.xs
观察到的脆弱结果:
HTTP/1.1 500 Internal Server Error
TOTAL_TIME=6.300s
Internal Server Error
启动 Gotenberg 8.31.0:
docker compose -f docker-compose.latest.yml down -v
docker compose -f docker-compose.latest.yml up -d
docker compose -f docker-compose.latest.yml logs --tail=100 gotenberg
检查版本:
curl -s http://127.0.0.1:3000/version
运行同样的手动延迟检查:
python3 manual_verify.py http://127.0.0.1:3000
观察到的已修补版本结果:
HTTP/1.1 400 Bad Request
TOTAL_TIME=0.145s
At least one PDF engine cannot process the requested metadata, while others may have failed to convert due to different issues
验证模板:
nuclei -duc -validate -t CVE-2026-42589.yaml
对脆弱目标运行:
nuclei -duc -u http://127.0.0.1:3000 -t CVE-2026-42589.yaml
预期行为:
8.29.1:在延迟的 500 响应后匹配8.31.0:无匹配观察到的脆弱结果:
[CVE-2026-42589] [http] [critical] http://127.0.0.1:3000/forms/pdfengines/metadata/write
[INF] Scan completed in 6.245907708s. 1 matches found.
观察到的已修补版本结果:
[INF] Scan completed in 93.01425ms. No results found.