Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2025-01409
- Vendor: 大台北區瓦斯股份有限公司
- Title: 大台北區瓦斯股份有限公司全球資訊網存在任意檔案下載弱點
- Introduction: 可透過網站提供的「ReadFile2」服務,下載任可已知名稱的現存檔案,包括Controllers、Views、Modeules等目錄下的原始碼及專案目錄的web.config等
處理狀態
目前狀態
-
新提交
-
已審核
-
已通報
-
已修補
-
未複測
-
公開
處理歷程
- 2025/11/12 14:42:59 : 新提交 (由 阿美 更新此狀態)
- 2025/11/12 14:46:14 : 新提交 (由 阿美 更新此狀態)
- 2025/11/16 17:19:41 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/11/17 17:59:54 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/11/17 17:59:54 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/11/17 17:59:54 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2026/01/09 16:45:03 : 已修補 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2026/01/17 03:00:08 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2025-01409
- 通報者:gmwa (阿美)
- 風險:高
- 類型:任意檔案下載 (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
相關網址
敘述
1.檢視網站原始碼 <img src="/ReadFile2/?p=AdBanner&n=2014429163014.gif" ,發現以 ReadFile2 功能存取網站資源,經測試 https://www.taipeigas.com.tw/readfile?p=&n=../../web.config ,確實可下載系統檔案。
2.檢視 web.config 的內容,確認此網站以 ASP.NET MVC 框架開發。
3.嘗試存取 https://www.taipeigas.com.tw/readfile?p=&n=../../Controllers/aboutController.cs ,亦可下載源碼檔,表示此網站非以預編譯方式部署,可以透過檢視網站原始碼,盡可能找出Controller,例如發現:About、Service、Apply、Safety、Product、Rental、News、Readfile2及Readimg 等Controller。
3.再由Controller的源碼可得知Views的源碼檔名稱,例如可下載 https://www.taipeigas.com.tw/readfile?p=&n=../../views/about/index.aspx 的源碼。
4.由Controller的源碼亦可得知 Models 模組源碼檔,例如 https://www.taipeigas.com.tw/ReadFile2/?p=&n=../../models/tblNewsClassRepository.cs 。
修補建議
1. 透過資料夾權限設定,限制機敏資料夾的存取權。
2. ReadFile服務應確實檢查 p參數及n參數的值是否合理,例如:不允許P參數是空值;不允許n參數使用目錄遍歷形式(即../../ ....)