Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2022-00619
- Vendor: 台灣電力公司
- Title: [Bounty] 台灣電力公司 SQL Injection 漏洞
- Introduction: SQL Injection 資料庫注入
處理狀態
目前狀態
公開
Last Update : 2022/08/30
-
新提交
-
已審核
-
已通報
-
已修補
-
已複測
-
公開
處理歷程
- 2022/08/05 17:13:51 : 新提交 (由 K4iBr0 更新此狀態)
- 2022/08/05 23:07:37 : 新提交 (由 K4iBr0 更新此狀態)
- 2022/08/08 00:24:02 : 審核中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2022/08/18 14:45:17 : 複測申請中 (由 組織帳號 更新此狀態)
- 2022/08/26 09:14:35 : 複測申請中 (由 組織帳號 更新此狀態)
- 2022/08/26 09:17:43 : 確認已修補 (由 K4iBr0 更新此狀態)
- 2022/08/30 03:00:07 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2022-00619
- 通報者:Kaibro (K4iBr0)
- 風險:高
- 類型:資料庫注入攻擊 (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://greennet.taipower.com.tw/submission_pdf.aspx?id=12
敘述
id
參數未作任何過濾即拼接至 SQL 語法上執行,導致存在 SQL Injection 資料庫注入漏洞,攻擊者可透過該漏洞取得資料庫中的資料。
由於該網站背後有 WAF 會偵測惡意注入語法,但其 WAF rule 不嚴謹,導致攻擊者可以插入 %C2%85
等字元即可繞過 WAF 偵測
舉例:
- 嘗試執行 WAITFOR DELAY '0:0:3',可以看到 Response 回應時間 > 3 秒
- 嘗試執行 WAITFOR DELAY '0:0:0',可以看到 Response 回應時間 < 1 秒
由以上 1. 和 2. 可證明 SQL Injection 漏洞存在,並且可繞過 WAF 偵測
附註:
該功能除了 SQL Injection 漏洞外,也有 Broken Access Control (IDOR) 漏洞,單純修改 id 流水號即可存取他人 pdf 文件
例如:
https://greennet.taipower.com.tw/submission_pdf.aspx?id=12
https://greennet.taipower.com.tw/submission_pdf.aspx?id=123
修補建議
- 程式執行前,應先檢查當前使用者是否存取該功能或檔案
- 使用 Prepare Statement 等方式處理 SQL 語法,避免使用者注入惡意語法
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。