返回首页
EN
H7 / SECURITY RESEARCH NOTES

CVE-2021-32682漏洞分析

前言

  • elFinder 是Github上广受欢迎的Web 开源文件管理器,基于jQuery UI和PHP编写。它的创作灵感来自 Mac OS X 操作系统中使用的 Finder 程序的简单性和便利性。

漏洞描述

  • 该漏洞源于用户使用elFinder创建新的zip存档时,服务端没有对请求中的name参数进行严格的过滤,导致参数被带入prox_open函数中执行,进而造成远程代码执行漏洞。

漏洞等级

  • 严重(CVSS:9.8)

影响版本

  • elFinder < 2.1.59

环境搭建

下载源码

本地部署

  • 下载到本地Web服务器目录后,将源代码目录中的**/php/connector.minimal.php-dist文件重命名为/php/connector.minimal.php**

  • 然后在浏览器中打开**/elfinder.html**即可,如下图所示:

PhpStorm + Xdebug调试环境搭建

  • 超时问题:

https://blog.csdn.net/xkdlzy/article/details/110880645

https://www2.xiebruce.top/1191.html

文件修改

- elFinderVolumeDriver.class.php
第6762行代码,cmd参数由phpfunction修改为zip

- elFinderVolumeDriver.class.php
第465行代码,useRemoteArchive参数由false修改为true

漏洞分析

str_replace() ->

漏洞复现

POC及EXP编写

参考链接

1.https://github.com/Studio-42/elFinder/issues/3295
2.https://xz.aliyun.com/t/10739