Is4yev/CVE-2026-48909
GitHub: Is4yev/CVE-2026-48909
针对 Joomla SP LMS 扩展 PHP 反序列化导致远程代码执行漏洞(CVE-2026-48909)的 PoC 检测与利用工具。
Stars: 0 | Forks: 0
# CVE-2026-48909 — SP LMS PHP Object Injection → RCE
[](https://www.cve.org/CVERecord?id=CVE-2026-48909)
[](https://vulnerability.circl.lu/vuln/cve-2026-48909)
[](https://cwe.mitre.org/data/definitions/502.html)
[](https://www.joomshaper.com/joomla-extensions/sp-lms)
[](https://www.joomshaper.com/joomla-extensions/sp-lms)
**作者:** Amin İsayev / Proxima Cyber Security
## 概述
**SP LMS** 是由 JoomShaper 开发的一款广受欢迎的 Joomla 学习管理系统扩展,拥有超过 100,000 次安装量。版本 ≤ 4.1.3 会将 `lmsOrders` cookie 直接传递给 `unserialize()` 而不进行任何验证,这使得未经身份验证的攻击者能够注入恶意的 PHP object,并通过 Joomla 原生的 gadget chain 实现 Remote Code Execution。
| 字段 | 详情 |
|---|---|
| **CVE ID** | CVE-2026-48909 |
| **GHSA** | GHSA-gf8c-xmwj-whrh |
| **受影响版本** | SP LMS (com_splms) 1.0.0 – 4.1.3 |
| **修复版本** | SP LMS ≥ 4.1.4 |
| **Joomla 要求** | < 5.2.2 (gadget chain 已在 5.2.2 中修复) |
| **CVSS 4.0** | **9.5 严重** — AV:N/AC:L/AT:P/PR:N/UI:N |
| **CWE** | CWE-502: Deserialization of Untrusted Data |
| **所需权限** | 无 |
| **披露日期** | 2026-05-26 |
| **发布日期** | 2026-06-20 |
## 漏洞详情
### 根本原因
`components/com_splms/models/cart.php` 第 28 行:
```
$cookie = Factory::getApplication()->input->cookie;
$raw = $cookie->get('lmsOrders', base64_encode(serialize(array())));
$decoded = base64_decode($raw);
$cartItems = unserialize($decoded); // ← untrusted user input
```
`lmsOrders` cookie 经过 base64 解码后直接传递给 `unserialize()`。攻击者可以完全控制反序列化的 object。
### Gadget Chain
Joomla 的 `FormattedtextLogger` 类提供了该 gadget:
```
lmsOrders cookie (attacker-controlled)
└─► unserialize() [cart.php:28]
└─► FormattedtextLogger.__destruct() [Joomla gadget]
└─► initFile() → File::write($path, $format)
└─► PHP code written to disk → RCE
```
### 绕过过滤
Joomla 的 `Input\Cookie::get()` 默认应用 `cmd` 过滤器,会从 cookie 值中剔除 `+`、`/` 和 `=` — 这些字符存在于标准的 base64 中。该漏洞利用使用了以下方法:
- **hex2bin()** 编码:以避免禁止的 PHP 字符(`$`, `_`, `{`, `}`, `\n`)
- **填充对齐**:确保 base64 长度可被 3 整除(无需 `=` 填充)
- **填充字符迭代**(62 种变体):以消除 base64 输出中的 `/` 和 `+`
## 概念验证 (PoC)
### 检测
```
python3 CVE-2026-48909.py https://target.com
```
```
[*] Target : https://target.com
[*] Path : /index.php?option=com_splms&view=cart
[*] Probe : lmsOrders=Tzo4OiJzdGRDbGFzcyI6MDp7fQ==
[VULNERABLE] HTTP 500 on probe vs 200 on benign — unserialize() called on cookie
[!] Update to SP LMS >= 4.1.4 immediately.
```
### 漏洞利用
```
python3 CVE-2026-48909_exploit.py https://target.com /var/www/html/tmp/x.php
```

**查找服务器路径**(如果未知):
```
# cPanel 托管 — 从 Joomla 错误页面泄露路径
curl -sk "https://target.com/administrator/" | grep -oP '\/home\d*\/[^"<\s]+'
# 常见的可尝试路径:
# /var/www/html/tmp/x.php
# /home/USER/public_html/tmp/x.php
# /var/www/vhosts/DOMAIN/httpdocs/tmp/x.php
```
## 环境要求
```
pip install requests
```
Python 3.10+
## 修复 / 缓解措施
1. 立即将 SP LMS **更新**至 **≥ 4.1.4** 版本
2. 将 Joomla **更新**至 **≥ 5.2.2** 以移除 gadget chain
3. 作为临时缓解措施 — 在反序列化之前验证并清理 `lmsOrders` cookie:
```
// Do NOT use unserialize() on user-controlled data
// Use json_encode/json_decode instead
$cartItems = json_decode(base64_decode($raw), true) ?? [];
```
## 时间线
| 日期 | 事件 |
|------|-------|
| 2026-04-XX | 发现漏洞 |
| 2026-05-02 | 报告给 JoomShaper |
| 2026-05-26 | 分配 CVE-2026-48909 |
| 2026-05-XX | 发布 SP LMS 4.1.4(补丁) |
| 2026-06-20 | 公开披露 |
## 参考
- [CVE-2026-48909 — cve.org](https://www.cve.org/CVERecord?id=CVE-2026-48909)
- [CVE-2026-48909 — NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-48909)
- [GHSA-gf8c-xmwj-whrh — GitHub 安全公告](https://github.com/advisories/GHSA-gf8c-xmwj-whrh)
- [Joomla PR #44428 — FormattedtextLogger gadget 补丁](https://github.com/joomla/joomla-cms/pull/44428)
- [CWE-502: Deserialization of Untrusted Data](https://cwe.mitre.org/data/definitions/502.html)
- [OWASP: PHP Object Injection](https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection)
## 免责声明
此工具发布仅供**教育目的**和**授权的安全测试**使用。
作者不对因使用此程序而造成的任何误用或损害负责。
**请勿在您不拥有或未获得明确书面许可进行测试的系统上使用。**
*Amin İsayev / Proxima Cyber Security — 2026*
标签:Go语言工具, Joomla, PHP对象注入, PoC, 反序列化, 安全, 暴力破解, 编程工具, 超时处理, 远程代码执行, 逆向工具